MonitorLogicalFileName.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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>MonitorLogicalFileName</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="1" frame="all" rowsep="1">
  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.</entry>
  45. </row>
  46. <row>
  47. <entry><emphasis>shotcount</emphasis></entry>
  48. <entry>Optional. An integer value indicating the number of times to
  49. generate the event before the monitoring job completes. A negative
  50. one (-1) value indicates the monitoring job continues until manually
  51. aborted. If omitted, the default is 1.</entry>
  52. </row>
  53. <row>
  54. <entry><emphasis>espserverIPport</emphasis></entry>
  55. <entry>Optional. A null-terminated string containing the protocol,
  56. IP, port, and directory, or the DNS equivalent, of the ESP server
  57. program. This is usually the same IP and port as ECL Watch, with
  58. “/FileSpray” appended. If omitted, the default is the value
  59. contained in the lib_system.ws_fs_server attribute.</entry>
  60. </row>
  61. <row>
  62. <entry><emphasis>dfuwuid</emphasis></entry>
  63. <entry>The attribute name to recieve the null-terminated string
  64. containing the DFU workunit ID (DFUWUID) generated for the
  65. monitoring job.</entry>
  66. </row>
  67. <row>
  68. <entry>Return:<emphasis> </emphasis></entry>
  69. <entry>fMonitorLogicalFileName returns a null-terminated string
  70. containing the DFU workunit ID (DFUWUID).</entry>
  71. </row>
  72. </tbody>
  73. </tgroup>
  74. </informaltable>
  75. <para>The <emphasis role="bold">MonitorLogicalFileName </emphasis>function
  76. creates a file monitor job in the DFU Server. Once the job is received it
  77. goes into a 'monitoring' mode (which can be seen in the eclwatch DFU
  78. Workunit display), which polls at a fixed interval (default 15 mins). If an
  79. appropriately named file arrives in this interval it will fire the
  80. <emphasis>event</emphasis> with the name of the triggering object as the
  81. event subtype (see the EVENT function).</para>
  82. <para>This function does not support wildcard characters. To monitor
  83. physical files or directories using wildcards, use the <link
  84. linkend="MonitorFile">MonitorFile</link> function.</para>
  85. <para>This process continues until either:</para>
  86. <para>1) The <emphasis>shotcount</emphasis> number of events have been
  87. generated.</para>
  88. <para>2) The user aborts the DFU workunit.</para>
  89. <para>The STD.File.AbortDfuWorkunit and STD.File.WaitDfuWorkunit functions
  90. can be used to abort or wait for the DFU job by passing them the returned
  91. <emphasis>dfuwuid</emphasis>.</para>
  92. <para><emphasis role="bold">Note the following caveats and
  93. restrictions:</emphasis></para>
  94. <para>1) If a matching file already exists when the DFU Monitoring job is
  95. started, that file will <emphasis role="underline">not</emphasis> generate
  96. an event. It will only generate an event once the file has been deleted and
  97. recreated.</para>
  98. <para>2) If a file is created and then deleted (or deleted then re-created)
  99. between polling intervals, it will not be seen by the monitor and will not
  100. trigger an event.</para>
  101. <para>3) Events are only generated on the polling interval.</para>
  102. <para>Example:</para>
  103. <programlisting format="linespecific">EventName := 'MyFileEvent';
  104. FileName := 'test::myfile';
  105. IF (STD.File.FileExists(FileName),
  106. STD.File.DeleteLogicalFile(FileName));
  107. STD.File.MonitorLogicalFileName(EventName,FileName);
  108. OUTPUT('File Created') : WHEN(EVENT(EventName,'*'),COUNT(1));
  109. rec := RECORD
  110. STRING10 key;
  111. STRING10 val;
  112. END;
  113. afile := DATASET([{ 'A', '0'}], rec);
  114. OUTPUT(afile,,FileName);
  115. </programlisting>
  116. </sect1>