|
|
|
|
- Handling errors
- Listing the subdirectories of a directory
fListFile (Function) In french: fListeFichier Lists the files found in a directory and returns the list of files. The listed files are sought from the given directory. Other use: For each file found, fListFile can automatically call a specific procedure written in WLanguage. This procedure is used to handle the current file. In this case, fListFile returns the number of listed files. Remark: In 64-bit Windows, you can access a system directory from a 32-bit executable in a different directory. For more details, see Native 64-bit and native 32-bit. Versions 18 and later Syntax
Listing the files found in a directory Hide the details
<Result> = fListFile(<Path and generic name of files> , <Options>)
<Result>: Character string Full name of listed files, separated by CR characters (Carriage Return).
Caution: The function returns the files with short or long names that match the filter. <Path and generic name of files>: Character string Path and generic name of files to list. Generic characters (* and?) are allowed. Special cases:- if the directory and the drive are not specified: the search path is built from the current drive and from the current directory for this drive.
- if the drive is not specified while the directory is specified: the search path is built from the current drive and from the directory passed as parameter.
- if the drive is specified while the directory is not specified, the search path is built from the specified drive and from the current directory for this drive.
New in version 15 <Options>: Combination of Integer constants Option used to define the information returned as well as the type of iteration performed for the directory files:
| | fdFullInformation | Each line (separated by carriage return - CR) contains the following information:
<Full file name> + TAB + <Size in bytes> + TAB + <Date of last modification> + TAB + <File attributes> The date is in YYYYMMDDHHmmSS format. The attributes are identical to the ones returned by fAttribute. | fdInterruptible | The iteration can be interrupted by pressing ESC. The function will return the name of the listed files until the interruption. | New in version 15fPathUNICODE | <Result> will be a string in Unicode format. | frNoHiddenDirectory | If the frFullInformation constant is used, the hidden directories are not listed (attribute = "H"). | frNoHiddenFile | If the frFullInformation constant is used, the hidden files are not listed (attribute = "H"). | frNotRecursive | The iteration is non-recursive. Subdirectories are ignored. | frRecursive (Default value) | The iteration is recursive. Subdirectories are automatically taken into account. |
Remarks Handling errors Caution: fListFile returns no error code. To determine if this function has generated an error, use ErrorInfo with the errMessage constant.
Related Examples:
|
Unit examples (WINDEV): The fListFile function
[ + ] Using fListFile and its syntax that directly returns the list of files/directories found in string format.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|