Extensions Reference

Extensions Reference > fsFilesystem


fsEnumFolder

int fsEnumFolder(string Folder);

 

Enumerates the specified folder and caches results

The fsEnumFolder function enumerates the specified folder and caches the files and subfolders within it for future use. This is the first function you must call when enumerating (listing) the contents of a directory. It prepares certain internal states that are required for file and folder enumeration, as well as wiping the cache so that previous enumeration results are erased. If you wish to combine enumerations, call this function first to reset the cache and then call fsEnumFolderAppend.

 

Parameters

Folder

The folder to enumerate. This may be a path and folder without a trailing backslash (eg: "C:\TestFolder" and "C:\TestFolder\" are both legal). This may also be a wildcard pattern search ("C:\Test\*.bmp").

 

Return Value

The total number of files and subfolders in the specified folder.

 

Example Code

// iTotal contains the number of files and subfolders in the root of C:
int iTotal = fsEnumFolder("C:\\");