File System Component
Version 6.6
MDK-Professional Middleware for Devices with Flash File System
|
Directory maintenance routines perform directory management operations. More...
Functions | |
fsStatus | fpwd (const char *drive, char *buf, uint32_t len) |
Print working directory. | |
fsStatus | fchdir (const char *path) |
Change working directory. | |
fsStatus | fmkdir (const char *path) |
Create a directory. | |
fsStatus | frmdir (const char *path, const char *options) |
Remove a directory. | |
The routines are thread safe.
fsStatus fchdir | ( | const char * | path | ) |
[in] | path | string specifying the directory path. |
The function fchdir changes current working directory. It causes the directory named by the path argument to become the current working directory, which is the starting point for path searches for pathnames not beginning with '/' or '\'.
The argument path is specifying the directory path. If the drive prefix is omitted, the Current Drive is used.
fsStatus fmkdir | ( | const char * | path | ) |
[in] | path | string specifying directory path. |
The function fmkdir is used to make a new directory or any intermediate directories in the path.
The argument path is specifying the directory path. If the drive prefix is omitted, the Current Drive is used.
fsStatus fpwd | ( | const char * | drive, |
char * | buf, | ||
uint32_t | len | ||
) |
[in] | drive | a string specifying the memory or storage device. |
[out] | buf | pointer to string buffer. |
[in] | len | string buffer length. |
The function fpwd prints current working directory.
The argument drive specifies the Drives, Memory Devices and Drivers. The Current Drive is used if an empty string is provided. A NULL pointer is not allowed and will be rejected.
The argument buf point to the array where the absolute path of the current working directory is stored.
The argument len is the size in bytes of the buf array. If len argument is equal to zero, function returns with fsInvalidParameter and content of buf remains unchanged. If current working directory path does not fit into the array specified by buf and len, function returns with fsInvalidParameter and buf contains an empty string.
fsStatus frmdir | ( | const char * | path, |
const char * | options | ||
) |
[in] | path | string specifying directory path. |
[in] | options | string specifying function options. |
The function frmdir removes a directory if it is empty. Argument options is used to specify function options.
The argument path is specifying the directory path. If the drive prefix is omitted, the Current Drive is used.
The argument options can be NULL when options are not used or a pointer to a string specifying following option:
Option | Description |
---|---|
/S | Remove all directories and files in the specified directory including the directory itself. |