PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Caution: fDir keeps an access to the directory
  • Browsing directories
  • Windows
  • Using fDir in the threads
  • Equivalence
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
Finds a file or a directory. This search can be performed with wildcard characters (*,?).
Notes:
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the 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 QueriesJavaPHPAjaxUser code (UMC)
// Find the "C:\MyDirectory\MyFile.doc" file
ResSearch = fDir("C:\MyDirectory\MyFile.doc")

// Find the "C:\MyDirectory\MyFile.doc" file
ResSearch = fDir("C:\MyDirectory\MyFile.doc", frFile)

// Find the "C:\MyDirectory\" directory
ResSearch = fDir("C:\MyDirectory\", frDirectory)

// Find the first ".doc" file in the "C:\MyDirectory" directory
ResSearch = fDir("C:\MyDirectory\*.doc")
Windows Mobile
// Find the "\MyDirectory\MyFile.psw" file
ResSearch = fDir("C:\MyDirectory\MyFile.psw")

// Find the "\MyDirectory\MyFile.psw" file
ResSearch = fDir("C:\MyDirectory\MyFile.psw", frFile)

// Find the "\MyDirectory\" directory
ResSearch = fDir("\MyDirectory\", frDirectory)

// Find the first ".psw" file the in "\MyDirectory\" directory
ResSearch = fDir("C:\MyDirectory\*.psw")
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 find out whether an error was generated by this function, use ErrorInfo associated with the errMessage constant.
<Name of Sought File or Directory>: Character string (with quotes)
Name and full (or relative) path of 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 to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories, as well as onto 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 to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories, as well as onto 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 to a relative path in relation 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 has the rights to write into its setup directory or into one of its sub-directories, as well as onto the external memory (SDCard).
Windows Mobile This path must be a full path or a UNC path. It cannot be a relative path.
AndroidAndroid Widget Java If the "*.*" expression is used, only the files that have an extension will be copied.
Versions 17 and later
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 sub-directories.
New in version 17
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 sub-directories.
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation 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 sub-directories.
<Options>: Optional Integer constant (or combination of constants)
Search options:
fPathUNICODE
Versions 15 and later
<Result> will be a character string in Unicode format.
This constant can be combined with frFile or frDirectory.
New in version 15
<Result> will be a character string in Unicode format.
This constant can be combined with frFile or frDirectory.
<Result> will be a character string in Unicode format.
This constant can be combined with frFile or frDirectory.
frFile
(Default value)
Find a file.
frDirectoryFind a directory.
Remarks

Caution: fDir keeps an access to the directory

The call to fDir locks the directory and prevents you from deleting it or from renaming it. To unlock the directory, add the following code line to your process:
fDir("")

Browsing directories

The browses of directories performed by fDir must not be nested.
fCopyFile must not be used when fDir 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(FileName) = "TOTO" THEN Info("File found")
But you should write:
IF fDir(FileName) ~= "TOTO" THEN Info("File found")

Using fDir in the threads

fDir should not be used at the same time in two different threads.
Indeed, the last browse operation requested by fDir automatically replaces the current one.
Windows Mobile

Equivalence

The operating mode of fDir is equivalent to the operating mode of ceDir.
The only difference is:
  • fDir handles a file or a directory found on the Pocket PC from a WINDEV Mobile application.
  • ceDir handles a file or a directory found on the Pocket PC from a standard WINDEV application.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment