Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Special cases
  • WLanguage procedure
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.
// Nom du répertoire à surveiller
sNomRepertoire is string = "C:\Temp\MonRep"
// La procédure fSurveilleRépertoire_Callback sera appelée
// lorsqu'un fichier ou un répertoire contenu dans le répertoire "C:\Temp\MonRep" sera modifié.  
IF fTrackDirectory(sNomRepertoire, fSurveilleRépertoire_Callback, ftCreateFile + ...
ftModifyFile + ftDeleteFile + ftRename) THEN
// On informe l'utilisateur de la mise sous surveillance du répertoire
Info("La mise sous surveillance du répertoire " + sNomRepertoire + " a réussi.")
// On informe l'utilisateur de l'échec de la mise sous surveillance du répertoire
Info("La mise sous surveillance du répertoire " + sNomRepertoire + " a échoué.")
// Code de la procédure
PROCÉDURE fSurveilleRépertoire_Callback(sNomRepertoire, sNomFichier, nAction, sAncienNomFichier)
ExecuteMainThread(AjoutTable, sNomRepertoire, sNomFichier, nAction, sAncienNomFichier)
// Procédure qui agit sur le thread principal
PROCÉDURE AjoutTable(sNomRepertoire, sNomFichier, nAction, sAncienNomFichier)
sDesignationAction is string
// La désignation de l'action subie dépend de nAction
SWITCH nAction
CASE ftCreateFile: sDesignationAction = "Création de fichier"
CASE ftDeleteFile: sDesignationAction = "Suppression de fichier"
CASE ftModifyFile: sDesignationAction = "Modification de fichier"
CASE ftRename: sDesignationAction = "Renommage de fichier"
// Ajout d'une ligne contenant les informations de la modification
// dans la table TABLE_MODIFICATIONS
TableAddLine(TABLE_MODIFICATIONS, sNomRepertoire, sNomFichier, ...
sDesignationAction, sAncienNomFichier)
<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
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

  • The fTrackDirectory function only monitors the contents of the. 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:
  • 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: wd270std.dll
Minimum version required
  • Version 18
This page is also available for…
Click [Add] to post a comment