MonitorLogicalFileName.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <sect1 id="MonitorLogicalFileName">
  5. <title><emphasis role="bold">MonitorLogicalFileName</emphasis></title>
  6. <para><emphasis role="bold">STD.File.MonitorLogicalFileName<indexterm>
  7. <primary>STD.File.MonitorLogicalFileName</primary>
  8. </indexterm><indexterm>
  9. <primary>File.MonitorLogicalFileName</primary>
  10. </indexterm><indexterm>
  11. <primary>MonitorLogicalFileName</primary>
  12. </indexterm>(</emphasis> <emphasis> event, </emphasis> <emphasis
  13. role="bold"> </emphasis> <emphasis>filename, </emphasis> <emphasis
  14. role="bold"> [</emphasis> <emphasis>, shotcount </emphasis> <emphasis
  15. role="bold">] [</emphasis> <emphasis>, espserverIPport </emphasis> <emphasis
  16. role="bold">] )</emphasis> <emphasis></emphasis></para>
  17. <para><emphasis>dfuwuid </emphasis> <emphasis role="bold">:=
  18. STD.File.fMonitorLogicalFileName<indexterm>
  19. <primary>STD.File.fMonitorLogicalFileName</primary>
  20. </indexterm><indexterm>
  21. <primary>File.fMonitorLogicalFileName</primary>
  22. </indexterm><indexterm>
  23. <primary>fMonitorLogicalFileName</primary>
  24. </indexterm>(</emphasis> <emphasis> event, </emphasis> <emphasis
  25. role="bold"> </emphasis> <emphasis>filename, </emphasis> <emphasis
  26. role="bold"> [</emphasis> <emphasis>, shotcount </emphasis> <emphasis
  27. role="bold">] [</emphasis> <emphasis>, espserverIPport </emphasis> <emphasis
  28. role="bold">] );</emphasis></para>
  29. <informaltable colsep="0" frame="none" rowsep="0">
  30. <tgroup cols="2">
  31. <colspec colwidth="80.50pt" />
  32. <colspec />
  33. <tbody>
  34. <row>
  35. <entry><emphasis>event</emphasis></entry>
  36. <entry>A null-terminated string containing the user-defined name of
  37. the event to fire when the <emphasis>filename</emphasis> appears.
  38. This value is used as the first parameter to the EVENT
  39. function.</entry>
  40. </row>
  41. <row>
  42. <entry><emphasis>filename</emphasis></entry>
  43. <entry>A null-terminated string containing the name of the logical
  44. file in the DFU to monitor. This may contain wildcard characters ( *
  45. and ?).</entry>
  46. </row>
  47. <row>
  48. <entry><emphasis>shotcount</emphasis></entry>
  49. <entry>Optional. An integer value indicating the number of times to
  50. generate the event before the monitoring job completes. A negative
  51. one (-1) value indicates the monitoring job continues until manually
  52. aborted. If omitted, the default is 1.</entry>
  53. </row>
  54. <row>
  55. <entry><emphasis>espserverIPport</emphasis></entry>
  56. <entry>Optional. A null-terminated string containing the protocol,
  57. IP, port, and directory, or the DNS equivalent, of the ESP server
  58. program. This is usually the same IP and port as ECL Watch, with
  59. “/FileSpray” appended. If omitted, the default is the value
  60. contained in the lib_system.ws_fs_server attribute.</entry>
  61. </row>
  62. <row>
  63. <entry><emphasis>dfuwuid</emphasis></entry>
  64. <entry>The attribute name to recieve the null-terminated string
  65. containing the DFU workunit ID (DFUWUID) generated for the
  66. monitoring job.</entry>
  67. </row>
  68. <row>
  69. <entry>Return:<emphasis> </emphasis></entry>
  70. <entry>fMonitorLogicalFileName returns a null-terminated string
  71. containing the DFU workunit ID (DFUWUID).</entry>
  72. </row>
  73. </tbody>
  74. </tgroup>
  75. </informaltable>
  76. <para>The <emphasis role="bold">MonitorLogicalFileName </emphasis>function
  77. creates a file monitor job in the DFU Server. Once the job is received it
  78. goes into a 'monitoring' mode (which can be seen in the eclwatch DFU
  79. Workunit display), which polls at a fixed interval (default 15 mins). If an
  80. appropriately named file arrives in this interval it will fire the
  81. <emphasis>event</emphasis> with the name of the triggering object as the
  82. event subtype (see the EVENT function).</para>
  83. <para>This process continues until either:</para>
  84. <para>1) The <emphasis>shotcount</emphasis> number of events have been
  85. generated.</para>
  86. <para>2) The user aborts the DFU workunit.</para>
  87. <para>The STD.File.AbortDfuWorkunit and STD.File.WaitDfuWorkunit functions
  88. can be used to abort or wait for the DFU job by passing them the returned
  89. <emphasis>dfuwuid</emphasis>.</para>
  90. <para><emphasis role="bold">Note the following caveats and
  91. restrictions:</emphasis></para>
  92. <para>1) If a matching file already exists when the DFU Monitoring job is
  93. started, that file will <emphasis role="underline">not</emphasis> generate
  94. an event. It will only generate an event once the file has been deleted and
  95. recreated.</para>
  96. <para>2) If a file is created and then deleted (or deleted then re-created)
  97. between polling intervals, it will not be seen by the monitor and will not
  98. trigger an event.</para>
  99. <para>3) Events are only generated on the polling interval.</para>
  100. <para>Example:</para>
  101. <programlisting format="linespecific">EventName := 'MyFileEvent';
  102. FileName := 'test::myfile';
  103. IF (STD.File.FileExists(FileName),
  104. STD.File.DeleteLogicalFile(FileName));
  105. STD.File.MonitorLogicalFileName(EventName,FileName);
  106. OUTPUT('File Created') : WHEN(EVENT(EventName,'*'),COUNT(1));
  107. rec := RECORD
  108. STRING10 key;
  109. STRING10 val;
  110. END;
  111. afile := DATASET([{ 'A', '0'}], rec);
  112. OUTPUT(afile,,FileName);
  113. </programlisting>
  114. </sect1>