The ffind function searches the Flash File System directory for files matching the specified pattern filter. Matching file information is stored in the info structure. ffind is invoked once for each matching file until a non-zero value is returned. The pattern filter may include an optional drive prefix. If the drive prefix is excluded, ffind uses the default drive specified in the FILE_CONFIG.C configuration file. The following values are supported for the drive prefix: | Drive Prefix | Description |
|---|
| "F:" | Embedded Flash drive. | | "S:" | SPI Flash drive. | | "M:" | Memory Card drive. | | "R:" | Ram drive. |
The pattern filter must include a filename pattern to match. Wildcards may be included in the filename. For example: | Pattern | Description |
|---|
"*" "*.*" | Search for all files in the directory. | | "abc*" | Search for files that begin with abc. | | "*.htm" | Search for files that end with .htm. | | "abc*.text" | Search for files that begin with abc and that end with .text. |
The ffind function is in the RL-FlashFS library. The prototype is defined in rtl.h. Note Before invoking the ffind function, you must set the fileID member of the info structure to 0. For example:
.
info.fileID = 0;
while (ffind ("R:*.*",&info) == 0)
.
This member of the info structure is used to identify the first call to ffind. - Flash File System filenames are null-teminated strings.
- The dot character ('.') has no special meaning for the Flash File System. It is not used as a separator for the file name and file type.
|