|
|
|
|
WLanguage procedure called by fWatchDirectory WLanguage procedure ("callback") called by fWatchDirectory when a change is made to the watched directory. This can be a local, global, or internal.
sDirectoryName is string = "C:\Temp\MyDir"
IF fWatchDirectory(sDirectoryName, fWatchDirectory_Callback, fwCreateFile + ...
fwModifyFile + fwDeleteFile + fwRename) THEN
Info("The " + sDirectoryName + " directory will be watched.")
ELSE
Info("The " + sDirectoryName + " directory will not be watched.")
END
PROCEDURE fWatchDirectory_Callback(sDirectoryName, sFileName, nAction, sOldFileName)
ExecuteMainThread(AddTable,sDirectoryName, sFileName, nAction, sOldFileName)
PROCEDURE AddTable(sDirectoryName, sFileName, nAction, sOldFileName)
sActionDesignation is string
SWITCH nAction
CASE fwCreateFile: sActionDesignation = "Creating files"
CASE fwDeleteFile: sActionDesignation = "Deleting files"
CASE fwModifyFile: sActionDesignation = "Modifying files"
CASE fwRename: sActionDesignation = "Renaming files"
END
TableAddLine(TABLE_MODIFICATIONS, sDirectoryName, sFileName, , ...
sActionDesignation, sOldFileName)
Syntax
fWatchDirectory_Callback(<Name of the watched directory> , <Name of modified element> , <Action> , <Former name>)
<Name of the watched directory>: Character string Full name of the watched directory. <Name of modified element>: Character string Name of the modified file or directory. <Action>: Integer constant Action performed:
| | fwCreateFile | The <Name of modified element> file or directory was created in <Directory>. | fwDeleteFile | The <Name of modified element> file or directory was deleted from <Directory>. | fwModifyFile | The <Name of modified element> file or directory was modified in <Directory>. | fwRename | The <Name of modified element> file or directory was renamed in <Directory>. |
<Former name>: Character string Former name of the modified file or directory if they were renamed. Remarks Caution This WLanguage procedure is run in a WLanguage thread. Caution: The following processes cannot be run in the threads: - opening windows with WLanguage functions such as Open, Use, Close, ... A specific management mode must be implemented if some windows must be handled in threads (rare case). For more details, see Opening a window in a secondary thread.
- managing events.
- managing timers.
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|