![]() |
File System Component
Version 6.0
MDK-Professional Middleware for Devices with Flash File System
|
File maintenance routines perform file management operations. More...
Functions | |
fsStatus | fdelete (const char *path) |
Delete a file or directory with given path name. | |
fsStatus | ffind (const char *pattern, fsFileInfo *info) |
Find a file or directory matching search pattern. | |
fsStatus | frename (const char *path, const char *newname) |
Rename a file or directory with given path name to a new name. | |
fsStatus | fattrib (const char *path, const char *attr) |
Change file attributes. | |
The routines are thread safe.
fsStatus fattrib | ( | const char * | path, |
const char * | attr | ||
) |
[in] | path | string specifying file or directory path. |
[in] | attr | string specifying file or directory attributes to be modified. The following characters are allowed within attr string:
|
The function fattrib changes file attributes.
The argument path is a pointer to the string specifying file path and can contain:
The argument attr is specifying file attributes to be modified. The following characters are allowed within par string:
Character | Function |
---|---|
+ | Sets an attribute |
- | Clears an attribute |
R | Read-only file attribute |
A | Archive file attribute |
S | System file attribute |
H | Hidden file attribute |
Code Example
fsStatus fdelete | ( | const char * | path | ) |
[in] | path | a string specifying the file or directory to be deleted. |
The function fdelete removes a file or folder from the File System.
The argument path is specifying the file or folder to be deleted and can contain:
Code Example
fsStatus ffind | ( | const char * | pattern, |
fsFileInfo * | info | ||
) |
[in] | pattern | string specifying the pattern.
|
[out] | info | structure storing information about matching files. |
The function ffind searches for files that match specific patterns. The argument pattern is specifying the searching rule and can include:
Pattern | Description |
---|---|
"*" or "*.*" | Searches for all files in the directory |
"abc*" | Searches for files that begin with abc |
"*.htm" | Searches for files that end with .htm |
"abc*.text" | Searches for files that begin with abc and that end with .text |
Code Example
fsStatus frename | ( | const char * | path, |
const char * | newname | ||
) |
[in] | path | string specifying the file or directory path. |
[in] | newname | string specifying new file or directory name. |
The function frename replaces the name of a file.
The argument path is specifying the current name of the file. The argument path can contain a drive prefix. In addition, you may also use "" (Default System Drive). For FAT media, path information may also be added.
The argument newname is specifying the new name of the file.
Code Example