ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Special cases
  • WLanguage procedure
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Triggers the tracking of a file. In case of file modification, a specific procedure is run in a thread.
Example
// Name of file to track
sFileName is string = "C:\Temp\MyDir\MyFile.extension"
// The ProcessModification procedure will be called when the
// "C:\Temp\MyDir\MyFile.extension" file is modified.
IF fTrackFile(sFileName, fTrackFile_Callback, ...
ftCreateFile + ftModifyFile + ftDeleteFile +  ...
ftRename) THEN
// Inform the user that the file will be tracked
Info("The " + sFileName + " file will be tracked.")
ELSE
// Inform the user that the file will not be tracked
Info("The " + sFileName + " file will not be tracked.")
END
 
// Code of the procedure
INTERNAL PROCEDURE fTrackFile_Callback(sFullName, 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"
END
// Add a line containing the information about the modification
// in the TABLE_MODIFICATIONS control
TableAddLine(TABLE_MODIFICATIONS, sFullName, sFileName, ...
sActionDesignation, sOldFileName)
END
Syntax
<Result> = fTrackFile(<File to track> , <WLanguage procedure> [, <Modifications to notify>])
<Result>: Boolean
  • True if the tracking of the file is enabled,
  • False otherwise. To get more details on the error, use ErrorInfo.
<File to track>: Character string
Full name of the file to track.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called when a change is made to the specified file.
For more details on this procedure, see Parameters of the procedure used by fTrackFile.
<Modifications to notify>: Optional Integer constant (or combination of constants)
Modifications performed in the file to track and for which the procedure must be run:
ftAllAll the possible actions will be tracked. Corresponds to ftCreateFile + ftModifyFile + ftRename + ftDeleteFile.
ftCreateFileThe <Name of modified file> file was created.
ftDeleteFileThe <Name of modified file> file was deleted.
ftModifyFileThe <Name of modified file> file was modified.
ftRenameThe <Name of modified file> file was renamed.
Remarks

Special cases

  • To stop tracking the file, use fTrackStop and fTrackStopAll.
  • To track the modifications performed on the content of a directory, use fTrackDirectory.
  • Limitations:
    • Only 5 files can be tracked at the same time.
    • You cannot track a file found at the root of a disk (for performance reasons).

WLanguage procedure

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

Last update: 08/23/2022

Send a report | Local help