PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Caution: fDir keeps access to the directory
  • Browsing directories
  • Windows
  • Using fDir in threads
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
Finds a file or a directory. This search can be performed with wildcard characters (*,?).
Remarks:
  • To test the existence of a file, use the fFileExist function.
  • To check the existence of a directory, disk or share, use fDirectoryExist.
  • To list the subdirectories of a directory, use fListDirectory.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)PHPAjax
// Recherche du fichier "C:\MonRépertoire\MonFichier.doc"
ResRecherche = fDir("C:\MonRépertoire\MonFichier.doc")
 
// Recherche du fichier "C:\MonRépertoire\MonFichier.doc"
ResRecherche = fDir("C:\MonRépertoire\MonFichier.doc", frFile)
 
// Recherche du répertoire "C:\MonRépertoire\"
ResRecherche = fDir("C:\MonRépertoire\", frDirectory)
 
// Recherche du premier fichier de type ".doc" dans le répertoire "C:\MonRépertoire"
ResRecherche = fDir("C:\MonRépertoire\*.doc")
Syntax
<Result> = fDir(<Name of sought file or directory> [, <Options>])
<Result>: Character string
  • Name of file (with its extension) or directory found.
  • Empty string ("") otherwise. To determine if this function has generated an error, use ErrorInfo with the errMessage constant.
<Name of sought file or directory>: Character string
Name and full (or relative) path of the sought file or directory (up to 260 characters). A UNC path can be used. You have the ability to use wildcard characters (*,?) in the name of the file.
If this parameter is empty, the function continues and searches for the name of the next corresponding file (or directory): this allows you to list the files or directories belonging to a given directory.
If this parameter corresponds to a directory name, this name may (or may not) end with "\".
Versions 15 and later
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories, as well as to the external memory (SDCard).
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories, as well as to the external memory (SDCard).
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories, as well as to the external memory (SDCard).
AndroidAndroid Widget Java If "*.*" is used, only files with an extension will be searched.
Versions 17 and later
iPhone/iPadIOS WidgetMac Catalyst This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone/iPad, an application has the rights to write into its setup directory or into one of its subdirectories.
New in version 17
iPhone/iPadIOS WidgetMac Catalyst This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone/iPad, an application has the rights to write into its setup directory or into one of its subdirectories.
iPhone/iPadIOS WidgetMac Catalyst This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: On iPhone/iPad, an application has the rights to write into its setup directory or into one of its subdirectories.
<Options>: Optional Integer constant (or combination of constants)
Search options:
fPathUNICODE
Versions 15 and later
<Result> will be a Unicode string.
This constant can be combined with frFile or frDirectory.
New in version 15
<Result> will be a Unicode string.
This constant can be combined with frFile or frDirectory.
<Result> will be a Unicode string.
This constant can be combined with frFile or frDirectory.
frFile
(Default value)
Find a file.
frDirectoryFind a directory.
Remarks

Caution: fDir keeps access to the directory

Calling fDir keeps an access to the directory, and prevents you from deleting or renaming it. To unlock the directory, add the following line of code to your process:
fDir("")

Browsing directories

Do not nest directory paths performed with the fDirfunction.
fDir must not be used when fCopyFile is used in a loop for browsing directories.

Windows

In Windows, a file name or a directory name can contain lowercase and/or uppercase characters (the names of the files are not "case sensitive").
Therefore, you should not write:
IF fDir(NomFichier) = "TOTO" THEN Info("Fichier trouvé")
But you should write:
IF fDir(NomFichier) ~= "TOTO" THEN Info("Fichier trouvé")

Using fDir in threads

It is not recommended to use the fDir function at the same time in two different threads.
In fact, the last route requested by fDir automatically replaces the current route.
Component: wd270std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment