File System Component
Version 6.16.6
MDK 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. More... | |
fsStatus | fchdir (const char *path) |
Change working directory. More... | |
fsStatus | fmkdir (const char *path) |
Create a directory. More... | |
fsStatus | frmdir (const char *path, const char *options) |
Remove a directory. More... | |
Directory maintenance routines perform directory management operations.
The routines are thread safe.
fsStatus fchdir | ( | const char * | path | ) |
Change working directory.
[in] | path | string specifying the directory path. |
The function fchdir changes the 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. If path is specifying a file, function returns with status code fsNotDirectory.
fsStatus fmkdir | ( | const char * | path | ) |
Create a directory.
[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. If path is specifying a file or directory that already exists, function returns with status code fsAlreadyExists.
fsStatus fpwd | ( | const char * | drive, |
char * | buf, | ||
uint32_t | len | ||
) |
Print working directory.
[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 the 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 less than maximum path length of the target file system, function returns with fsInvalidParameter and content of buf remains unchanged.
fsStatus frmdir | ( | const char * | path, |
const char * | options | ||
) |
Remove a directory.
[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. If path is specifying a file, function returns with status code fsNotDirectory.
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. |