Home | Sign in | English EN
  • Special cases
  • WLanguage procedure
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Detects the modifications performed on the content of a directory. Only the modifications performed on the files found in the directory are detected. In case of modification, a specific procedure is run in a thread.
// Name of directory to track
sDirectoryName is string = "C:\Temp\MyDir"
// The fTrackDirectory_Callback procedure will be called
// when a file or directory in the "C:\Temp\MyDir" directory is modified.  
IF fTrackDirectory(sDirectoryName, fTrackDirectory_Callback, ftCreateFile + ...
ftModifyFile + ftDeleteFile + ftRename) THEN
// Inform the user that the directory will be tracked
Info("The " + sDirectoryName + " directory will be tracked.")
// Inform the user that the directory will not be tracked
Info("The " + sDirectoryName + " directory will not be tracked.")
// Code of the procedure
PROCEDURE fTrackDirectory_Callback(sDirectoryName, sFileName, nAction, sOldFileName)
ExecuteMainThread(AddTable,sDirectoryName, sFileName, nAction, sOldFileName)
// Procedure that acts on the main thread
PROCEDURE AddTable(sDirectoryName, sFileName, nAction, sOldFileName)
sActionDesignation is string
// The designation of the action depends on nAction
SWITCH nAction
CASE ftCreateFile: sActionDesignation = "Creating files"
CASE ftDeleteFile: sActionDesignation = "Deleting files"
CASE ftModifyFile: sActionDesignation = "Modifying files"
CASE ftRename: sActionDesignation = "Renaming files"
// Add a line containing the information about the modification
// into the TABLE_MODIFICATIONS table
TableAddLine(TABLE_MODIFICATIONS, sDirectoryName, sFileName, , ...
sActionDesignation, sOldFileName)
<Result> = fTrackDirectory(<Directory to track> , <WLanguage procedure> [, <Modifications to notify> [, <Subdirectory>]])
<Result>: Boolean
  • True if the directory is tracked,
  • False otherwise. To get the details of the error, use ErrorInfo.
<Directory to track>: Character string (with quotes)
Full name of the directory to track.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called when a change is made in the specified directory.
For more details on this procedure, see Parameters of the procedure used by fTrackDirectory.
<Modifications to notify>: Optional Integer constant (or combination of constants)
Modifications performed in the content of the directory to track and for which the procedure must be run:
ftCreateFileCreating a file or a directory.
ftModifyFileModifying a file or a directory.
ftRenameRenaming a file or a directory.
ftDeleteFileDeleting a file or a directory.
ftAllAll the possible actions will be tracked. Corresponds to ftCreateFile + ftModifyFile + ftRename + ftDeleteFile.
<Subdirectory>: Boolean
  • True (default value) to process the sub-directories.
  • False otherwise.

Special cases

  • fTrackDirectory tracks the directory content only. The changes of directory name or location are ignored.
  • To stop tracking the directory, use fTrackStop and fTrackStopAll.
  • To track the modifications performed in a file, use fTrackFile.
  • Limitation: Only 5 directories can be tracked at the same time.

WLanguage procedure

The WLanguage procedure is run in a WLanguage thread.
Caution: The following processes cannot be run in the threads:
For more details on threads, see Managing threads.
Component: wd260std.dll
Minimum version required
  • Version 18
This page is also available for…
Click [Add] to post a comment