PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Special cases
  • WLanguage procedure
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
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.
Example
// Name of directory to track
sDirectoryName is string = "C:\Temp\MyDir"
// The ProcessDirModification procedure will be called
// whenever a file or directory found in the "C:\Temp\MyDir" directory is modified.  
IF fTrackDirectory(sDirectoryName, ProcessDirModification, ftCreateFile  ...
+ ftModifyFile + ftDeleteFile + ftRename) THEN
// Inform the user that the directory will be tracked
Info("The " + sDirectoryName + " directory will be tracked.")
ELSE
// Inform the user that the directory will not be tracked
Info("The " + sDirectoryName + " directory will not be tracked.")
END
// Code of the procedure
PROCEDURE ProcessDirModification(sDirectoryName, sFileName, nAction, sFormerFileName)
ExecuteMainThread(AddTable,sDirectoryName, sFileName, nAction, sFormerFileName)
// Procedure that acts on the main thread
PROCEDURE AddTable(sDirectoryName, sFileName, nAction, sFormerFileName)
 
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"
END
// Add a line containing the information about the modification
// into the TABLE_MODIFICATIONS table
TableAddLine(TABLE_MODIFICATIONS, sDirectoryName, sFileName, , ...
sActionDesignation, sFormerFileName)
Syntax
<Result> = fTrackDirectory(<Directory name> , <Procedure name> [, <Modifications to notify> [, <Subdirectory>]])
<Result>: Boolean
  • True if the directory is tracked,
  • False otherwise. To find out the error details, use ErrorInfo.
<Directory name>: Character string (with quotes)
Full name of the directory to track.
<Procedure name>: Character string (with or without quotes)
Name of the WLanguage procedure ("callback" procedure) that will be called when a change is detected in the specified directory.
This procedure has the following format:
PROCEDURE <Procedure name>(<Name of tracked directory>  
[, <Name of modified element>
[ <, <Action> [, <Former name>])
where:
  • <Name of tracked directory>: character string corresponding to the full name of the tracked directory.
  • <Name of modified element>: chaaracter string indicating the name of the modified file or directory.
  • <Action>: Integer constant that can take the following values:
    ftCreateFileThe <Name of modified element> file or directory was created in <Directory>.
    ftModifyFileThe <Name of modified element> file or directory was modified in <Directory>.
    ftRenameThe <Name of modified element> file or directory was renamed in <Directory>.
    ftDeleteFileThe <Name of modified element> file or directory was deleted from <Directory>.
  • <Former name>: Former name of the modified file or directory if the action performed is a rename operation.
Versions 22 and later
Note: This procedure can be an internal procedure.
New in version 22
Note: This procedure can be an internal procedure.
Note: This procedure can be an internal procedure.
<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.
Remarks

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:
See Managing threads for more details.
Component : wd250std.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment