File System Component  Version 6.6
MDK-Professional Middleware for Devices with Flash File System
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Directory Maintenance Routines

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.
 

Description

The routines are thread safe.

Function Documentation

fsStatus fchdir ( const char *  path)
Parameters
[in]pathstring specifying the directory path.
Returns
execution status fsStatus

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)
Parameters
[in]pathstring specifying directory path.
Returns
execution status fsStatus

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 
)
Parameters
[in]drivea string specifying the memory or storage device.
[out]bufpointer to string buffer.
[in]lenstring buffer length.
Returns
execution status fsStatus

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 
)
Parameters
[in]pathstring specifying directory path.
[in]optionsstring specifying function options.
Returns
execution status fsStatus

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.