瀏覽代碼

HPCC-13757 Update examples to use STD.File

Signed-off-by: Jim DeFabia <jamesdefabia@lexisnexis.com>
Jim DeFabia 10 年之前
父節點
當前提交
d3135b0073

+ 46 - 40
docs/ECLLanguageReference/ECLR_mods/BltInFunc-EVENT.xml

@@ -7,68 +7,71 @@
     </indexterm></title>
 
   <informalexample id="SchEvent">
-  <para><emphasis role="bold">EVENT<indexterm>
-      <primary>EVENT function</primary>
-    </indexterm>(</emphasis><emphasis> event , subtype </emphasis><emphasis
-  role="bold"> )</emphasis></para>
+    <para><emphasis role="bold">EVENT<indexterm>
+        <primary>EVENT function</primary>
+      </indexterm>(</emphasis><emphasis> event , subtype </emphasis><emphasis
+    role="bold"> )</emphasis></para>
 
-  <para><informaltable colsep="1" frame="all" rowsep="1">
-      <tgroup cols="2">
-        <colspec colwidth="79.30pt" />
+    <para><informaltable colsep="1" frame="all" rowsep="1">
+        <tgroup cols="2">
+          <colspec colwidth="79.30pt" />
 
-        <colspec />
+          <colspec />
 
-        <tbody>
-          <row>
-            <entry><emphasis>event</emphasis></entry>
+          <tbody>
+            <row>
+              <entry><emphasis>event</emphasis></entry>
 
-            <entry>A case-insensitive string constant naming the event to
-            trap.</entry>
-          </row>
+              <entry>A case-insensitive string constant naming the event to
+              trap.</entry>
+            </row>
 
-          <row>
-            <entry><emphasis>subtype</emphasis></entry>
+            <row>
+              <entry><emphasis>subtype</emphasis></entry>
 
-            <entry>A case-insensitive string constant naming the specific type
-            of event to trap. This may contain * and ? to wildcard-match the
-            event's sub-type.</entry>
-          </row>
+              <entry>A case-insensitive string constant naming the specific
+              type of event to trap. This may contain * and ? to
+              wildcard-match the event's sub-type.</entry>
+            </row>
 
-          <row>
-            <entry>Return:</entry>
+            <row>
+              <entry>Return:</entry>
 
-            <entry>EVENT returns a single event.</entry>
-          </row>
-        </tbody>
-      </tgroup>
-    </informaltable></para>
+              <entry>EVENT returns a single event.</entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </informaltable></para>
 
-  <para>The <emphasis role="bold">EVENT</emphasis> function returns a trigger
-  event, which may be used within the WHEN workflow service<indexterm>
-      <primary>WHEN workflow service</primary>
-    </indexterm> or the WAIT and NOTIFY actions.</para>
+    <para>The <emphasis role="bold">EVENT</emphasis> function returns a
+    trigger event, which may be used within the WHEN workflow
+    service<indexterm>
+        <primary>WHEN workflow service</primary>
+      </indexterm> or the WAIT and NOTIFY actions.</para>
 
-  <para>Example:</para>
+    <para>Example:</para>
 
-  <programlisting>EventName := 'MyFileEvent';
-FileName  := 'test::myfile';
+    <programlisting>IMPORT STD;
+MyEventName := 'MyFileEvent';
+MyFileName  := 'test::myfile';
 
-IF (FileServices.FileExists(FileName),
- FileServices.DeleteLogicalFile(FileName));
+IF (STD.File.FileExists(MyFileName),
+ STD.File.DeleteLogicalFile(MyFileName));
  //deletes the file if it already exists
 
-FileServices.MonitorLogicalFileName(EventName,FileName);
+STD.File.MonitorLogicalFileName(MyEventName,MyFileName);
  //sets up monitoring and the event name
  //to fire when the file is found
 
-OUTPUT('File Created') : WHEN(EVENT(EventName,'*'),COUNT(1));
+OUTPUT('File Created') : WHEN(EVENT(MyEventName,'*'),COUNT(1));
  //this OUTPUT occurs only after the event has fired
 
 afile := DATASET([{ 'A', '0'}], {STRING10 key,STRING10 val});
-OUTPUT(afile,,FileName);
+OUTPUT(afile,,MyFileName);
  //this creates a file that the DFU file monitor will find
  //when it periodically polls
 
+
 //**********************************
 EXPORT events := MODULE
   EXPORT dailyAtMidnight := CRON('0 0 * * *');
@@ -83,5 +86,8 @@ BUILD(oldies)  : WHEN(events.dailyAt(6));
 </programlisting>
   </informalexample>
 
-  <para>See Also: <link linkend="EVENTNAME">EVENTNAME</link>, <link linkend="EVENTEXTRA">EVENTEXTRA</link>, <link linkend="CRON">CRON</link>, <link linkend="WHEN">WHEN</link>, <link linkend="WAIT">WAIT</link>, <link linkend="NOTIFY">NOTIFY</link></para>
+  <para>See Also: <link linkend="EVENTNAME">EVENTNAME</link>, <link
+  linkend="EVENTEXTRA">EVENTEXTRA</link>, <link linkend="CRON">CRON</link>,
+  <link linkend="WHEN">WHEN</link>, <link linkend="WAIT">WAIT</link>, <link
+  linkend="NOTIFY">NOTIFY</link></para>
 </sect1>

+ 12 - 11
docs/ECLLanguageReference/ECLR_mods/BltInFunc-NOTHOR.xml

@@ -46,27 +46,28 @@
 
   <para>Example:</para>
 
-  <programlisting>rec := RECORD
+  <programlisting>IMPORT STD;
+rec := RECORD
   STRING10 S;
 END;
 
-srcnode := '10.150.199.2';
-srcdir := '/c$/test/';
+srcnode := '10.239.219.2'; 
+srcdir := '/var/lib/HPCCSystems/mydropzone/';
 
-dir := FileServices.RemoteDirectory(srcnode,srcdir,'*.txt',TRUE);
+dir := STD.File.RemoteDirectory(srcnode,srcdir,'*.txt',TRUE);
 
   //without NOTHOR this code gets this error:
   // "Cannot call function AddSuperFile in a non-global context"
 NOTHOR(SEQUENTIAL(
-  FileServices.DeleteSuperFile('MultiSuper1'),
-  FileServices.CreateSuperFile('MultiSuper1'),
-  FileServices.StartSuperFileTransaction(),
-  APPLY(dir,FileServices.AddSuperFile('MultiSuper1',
-  FileServices.ExternalLogicalFileName(srcnode,srcdir+name))),
-  FileServices.FinishSuperFileTransaction()));
+  STD.File.DeleteSuperFile('MultiSuper1'),
+  STD.File.CreateSuperFile('MultiSuper1'),
+  STD.File.StartSuperFileTransaction(),
+  APPLY(dir,STD.File.AddSuperFile('MultiSuper1',
+        STD.File.ExternalLogicalFileName(srcnode,srcdir+name))),
+  STD.File.FinishSuperFileTransaction()));
 
 F1 := DATASET('MultiSuper1', rec, THOR);
-OUTPUT(F1,,'testmulti1',overwrite);
+OUTPUT(F1,,'testmulti1',OVERWRITE);
 </programlisting>
 
   <para>See Also: <link linkend="SEQUENTIAL">SEQUENTIAL</link></para>

+ 12 - 11
docs/ECLLanguageReference/ECLR_mods/WkFlo-INDEPENDENT.xml

@@ -48,24 +48,25 @@
 
   <para>Example:</para>
 
-  <programlisting>  File1 := 'Filename1';
-  File2 := 'Filename2';
+  <programlisting>  IMPORT STD;
+  File1 := 'names1.txt';
+  File2 := 'names2.txt';
   
-  SrcIP := '10.150.50.14';
-  SrcPath := 'c:\\InputData\\';
+  SrcIP := '10.239.219.2';
+  SrcPath := '/var/lib/HPCCSystems/mydropzone/';
   DestPath := '~THOR::IN::';
-  ESPportIP := 'http://10.150.50.12:8010/FileSpray';
+  ESPportIP := 'http://192.168.56.120:8010/FileSpray';
   
   DeleteOldFiles :=
-     PARALLEL(FileServices.DeleteLogicalFile(DestPath+File1),
-              FileServices.DeleteLogicalFile(DestPath+File2))
+     PARALLEL(STD.File.DeleteLogicalFile(DestPath+File1),
+              STD.File.DeleteLogicalFile(DestPath+File2))
                            : INDEPENDENT;
   SprayNewFiles :=
-     PARALLEL(FileServices.SprayFixed(SrcIP,SrcPath+File1,255,
-                                      '400way',DestPath+File1,
+     PARALLEL(STD.File.SprayFixed(SrcIP,SrcPath+File1,11,
+                                      'mythor',DestPath+File1,
                                       -1,ESPportIP),
-              FileServices.SprayFixed(SrcIP,SrcPath+File2,255,
-                                     '400way',DestPath+File2,
+              STD.File.SprayFixed(SrcIP,SrcPath+File2,11,
+                                     'mythor',DestPath+File2,
                                      -1,ESPportIP))
                            : INDEPENDENT;
   SEQUENTIAL(DeleteOldFiles,SprayNewFiles);

+ 7 - 4
docs/ECLLanguageReference/ECLR_mods/WkFlo-WHEN.xml

@@ -63,10 +63,11 @@
 
   <para>Example:</para>
 
-  <programlisting>  IF (FileServices.FileExists('test::myfile'),
-     FileServices.DeleteLogicalFile('test::myfile'));
+  <programlisting>IMPORT STD;
+IF (STD.File.FileExists('test::myfile'),
+     STD.File.DeleteLogicalFile('test::myfile'));
      //deletes the file if it already exists
-  FileServices.MonitorLogicalFileName('MyFileEvent','test::myfile');
+  STD.File.MonitorLogicalFileName('MyFileEvent','test::myfile');
      //sets up monitoring and the event name
      //to fire when the file is found
   OUTPUT('File Created') : WHEN(EVENT('MyFileEvent','*'));
@@ -91,5 +92,7 @@
   BUILD(oldies) : WHEN(EVENT('FileDropped', 'x'));
 </programlisting>
 
-  <para>See Also: <link linkend="EVENT">EVENT</link>, <link linkend="CRON">CRON</link>, <link linkend="NOTIFY">NOTIFY</link>, <link linkend="WAIT">WAIT</link></para>
+  <para>See Also: <link linkend="EVENT">EVENT</link>, <link
+  linkend="CRON">CRON</link>, <link linkend="NOTIFY">NOTIFY</link>, <link
+  linkend="WAIT">WAIT</link></para>
 </sect1>

+ 7 - 7
docs/ECLProgrammersGuide/PRG_Mods/PrG_Automated_ECL.xml

@@ -50,11 +50,11 @@ PG.DeclareData.MAC_CountFieldValues(PG.DeclareData.Person.file,gender);
   correctly, you can automate the process by using ECLplus.</para>
 
   <para>Install the ECLplus program in its own directory on the same PC that
-  runs the ECL IDE, and create an ECLPLUS.INI file in the same folder with the correct settings
-  to access your cluster (see the <emphasis>Command Line ECL</emphasis>
-  section of the <emphasis>Client Tools </emphasis>PDF). Then you can open a
-  Command Prompt window and run the same query from the command line like
-  this:</para>
+  runs the ECL IDE, and create an ECLPLUS.INI file in the same folder with the
+  correct settings to access your cluster (see the <emphasis>Command Line
+  ECL</emphasis> section of the <emphasis>Client Tools </emphasis>PDF). Then
+  you can open a Command Prompt window and run the same query from the command
+  line like this:</para>
 
   <programlisting>C:\eclplus&gt;eclplus ecl=$ProgGuide.MAC_CountFieldValues(ProgrammersGuide.DeclareData.Person.File,gender)</programlisting>
 
@@ -88,8 +88,8 @@ gender     cnt
   <para>This will send the output to the “MyFile.txt” file on your local PC.
   For larger output files, you'll want to have the OUTPUT action in your ECL
   code write the result set to disk in the supercomputer then de-spray it to
-  your landing zone (you can use the FileServices.Despray function to do this
-  from within your ECL code).</para>
+  your landing zone (you can use the Standard Library's File.Despray function
+  to do this from within your ECL code).</para>
 
   <sect2 id="Using_Text_Files">
     <title>Using Text Files</title>

+ 8 - 7
docs/ECLProgrammersGuide/PRG_Mods/PrG_CreateMaintain_Superfiles.xml

@@ -307,10 +307,10 @@ SEQUENTIAL(
 IMPORT Std;
 
 SEQUENTIAL(
-  FileServices.StartSuperFileTransaction(),
-  FileServices.AddSuperFile($.DeclareData.DailyFile,$.DeclareData.SubFile5),  
-  FileServices.AddSuperFile($.DeclareData.DailyFile,$.DeclareData.SubFile6),
-  FileServices.FinishSuperFileTransaction());
+  Std.File.StartSuperFileTransaction(),
+  Std.File.AddSuperFile($.DeclareData.DailyFile,$.DeclareData.SubFile5),  
+  Std.File.AddSuperFile($.DeclareData.DailyFile,$.DeclareData.SubFile6),
+  Std.File.FinishSuperFileTransaction());
 </programlisting>
 
     <para>Once you've done that, re-running the above COUNT action should now
@@ -324,7 +324,8 @@ SEQUENTIAL(
     demonstrates one technique to list the component sub-files of a
     SuperFile:</para>
 
-    <programlisting>EXPORT MAC_ListSFsubfiles(SuperFile) := MACRO
+    <programlisting>IMPORT STD;
+EXPORT MAC_ListSFsubfiles(SuperFile) := MACRO
 
 #UNIQUENAME(SeedRec)
 %SeedRec% := DATASET([{''}], {STRING name});
@@ -333,11 +334,11 @@ SEQUENTIAL(
 TYPEOF(%SeedRec%) %Xform%(%SeedRec% L, INTEGER C) :=
           TRANSFORM
 SELF.name :=
-          FileServices.GetSuperFileSubName(SuperFile,C);
+          Std.File.GetSuperFileSubName(SuperFile,C);
 END;
 
 OUTPUT(NORMALIZE(%SeedRec%,
-FileServices.GetSuperFileSubCount(SuperFile),
+Std.File.GetSuperFileSubCount(SuperFile),
 %Xform%(LEFT,COUNTER)));
 ENDMACRO;
 </programlisting>

+ 11 - 10
docs/ECLProgrammersGuide/PRG_Mods/PrG_getting_things_done.xml

@@ -21,8 +21,9 @@
     QueryBuilder using ECL. Here’s the code (contained in the
     Default.ProgGuide MODULE attribute):</para>
 
-    <programlisting>EXPORT MAC_ScanFile(IP, infile, scansize) := MACRO
-ds := DATASET(FileServices.ExternalLogicalFileName(IP, infile),
+    <programlisting>IMPORT STD;
+EXPORT MAC_ScanFile(IP, infile, scansize) := MACRO
+ds := DATASET(Std.File.ExternalLogicalFileName(IP, infile),
      {DATA1 S},
       THOR )[1..scansize];
 OUTPUT(TABLE(ds,{hex := ds.s,txt := (STRING1)ds.s}),ALL);
@@ -55,14 +56,14 @@ ENDMACRO;
     zone the number of bytes to read (maximum 8K)</para>
 
     <para>The initial DATASET declaration uses the
-    FileServices.ExternalLogicalFileName function to name the file. Defining
-    the RECORD structure as a single DATA1 field is necessary to ensure that
-    both text and binary fields can be read correctly. Specifying the DATASET
-    as a THOR file (no matter what type of file it actually is) makes it
-    simple to read as a fixed-length record file. The square brackets at the
-    end of the DATASET declaration automatically limit the number of 1-byte
-    records read to the first <emphasis>scansize</emphasis> number of bytes in
-    the file.</para>
+    Std.File.ExternalLogicalFileName function to name the file. Defining the
+    RECORD structure as a single DATA1 field is necessary to ensure that both
+    text and binary fields can be read correctly. Specifying the DATASET as a
+    THOR file (no matter what type of file it actually is) makes it simple to
+    read as a fixed-length record file. The square brackets at the end of the
+    DATASET declaration automatically limit the number of 1-byte records read
+    to the first <emphasis>scansize</emphasis> number of bytes in the
+    file.</para>
 
     <para>The first OUTPUT action allows you to see the raw Hexadecimal data
     from the file.</para>

+ 5 - 6
docs/ECLScheduler/ECLSched-Mods/ECLSchedComp.xml

@@ -88,8 +88,7 @@
       </sect2>
 
       <sect2>
-        <title>Monitoring Functions in the FileServices Service
-        Library</title>
+        <title>Monitoring Functions in the Standard Library (STD.File)</title>
 
         <sect3>
           <title>MonitorFile</title>
@@ -118,10 +117,10 @@
               <term><emphasis role="bold">Note</emphasis>:</term>
 
               <listitem>
-                <para>DFUServer file monitoring (either using FileServices or
-                DFUPlus) creates a DFU Workunit. While monitoring, the
-                Workunit’s state is <emphasis>monitoring </emphasis>and once
-                it triggers the event, it is set to
+                <para>DFUServer file monitoring (either using the Standard
+                Library or DFUPlus) creates a DFU Workunit. While monitoring,
+                the Workunit’s state is <emphasis>monitoring </emphasis>and
+                once it triggers the event, it is set to
                 <emphasis>finished</emphasis>. You can Abort a “monitoring”
                 DFU Workunit to stop monitoring from ECL Watch.</para>
               </listitem>