|
- Managing errors
- Equivalence
- Listing the subdirectories of a directory
fListFile (Function) In french: fListeFichier 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 can return files whose short name corresponds to the filter used (while the long name does not correspond to this filter). <Path and generic name of files>: Character string (with quotes) 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 in 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.
Versions 15 and later New in version 15 Versions 17 and later New in version 17 <Options>: Combination of Integer constants Option used to define the information returned as well as the type of browse performed for the directory files:
| | Versions 15 and laterfPathUNICODE New in version 15fPathUNICODE fPathUNICODE | <Result> will be a string in Unicode format. | 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 HEX@ is in the format YYYYMMDDHHmmSS. The attributes are identical to the ones returned by fAttribute. | fdInterruptible | The browse can be interrupted by pressing the ESC key. The function will return the name of the listed files until the interruption. | frNotRecursive | The browse is a non-recursive browse. Subdirectories are ignored. | frRecursive (Default value) | The browse is recursive. Subdirectories are automatically taken into account. | frNoHiddenFile | If the frFullInformation constant is used, the hidden files are not listed (attribute = "H"). | frNoHiddenDirectory | If the frFullInformation constant is used, the hidden directories are not listed (attribute = "H"). |
Remarks Managing errors Caution: fListFile returns no error code. To find out 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…
|
|
|
| |
| | https://youtu.be/SE--Bx9Gq40 https://windevdesenvolvimento.blogspot.com/2019/09/dicas-2284-windev-webdev-mobile.html //PROCEDURE LISTA_DIRETORIO() s_ARQUIVOS_TODOS is string=fListDirectory(EDT_DIRETORIO) s_ARQUIVO_INDIVIDUAL is string="" TVT_DIRETORIO.DeleteAll() FOR EACH STRING s_ARQUIVO_INDIVIDUAL OF s_ARQUIVOS_TODOS SEPARATED BY CR n_POSICAO is int=TVT_DIRETORIO.AddLine() TVT_DIRETORIO.COL_01_DIRETORIO[n_POSICAO]=s_ARQUIVO_INDIVIDUAL TVT_DIRETORIO[n_POSICAO]..AddChildDelayed=LISTA_SUB_DIRETORIO_1 END LISTA_ARQUIVOS() // //PROCEDURE LISTA_ARQUIVOS() TableDeleteAll(TABLE_ARQUIVOS) s_ARQUIVOS_INDIVIDUAIS is string=fListFile(TVT_DIRETORIO.COL_01_DIRETORIO+"\*.*") FOR EACH STRING sARQUIVO_ OF s_ARQUIVOS_INDIVIDUAIS SEPARATED BY CR nPOSICAO is int=TABLE_ARQUIVOS.AddLine() TABLE_ARQUIVOS[nPOSICAO].COL_ARQUIVO=sARQUIVO_ END
|
|
|
|
| |
| |
| |
| |
| |
| |
| | |
| |