f_opendir

The f_opendir opens a directory.

FRESULT f_opendir (
  DIR* DirObject,      // Pointer to blank directory object structure
  const char* DirName  // Pointer to the directory name
);

Parameter

DirObject
Pointer to the blank directory object to be initialized
DirName
Pinter to the null-terminated string that specifies the full-path directory name to be opened. The directory separator is '/'. Because the FatFs module does not have a concept of current directory, a full-path name that followed from the root directory must be used. Leading space charactors are skipped if exist and heading '/' can be exist or omitted. The target directory name cannot be followed by a '/'. When open the root directory, specify "" or "/".

Return Values

FR_OK (0)
The function succeeded. The DirObject structure is used for subsequent calls to read the directory entries.
FR_NOPATH
Could not find the path.
FR_INVALID_NAME
The path name is invalid.
FR_NOT_READY
The disk drive cannot work due to no medium in the drive or any other reason.
FR_RW_ERROR
Any error occured in low level disk I/O.
FR_INCORRECT_DISK_CHANGE
Incorrect disk removal, such as a medium change during any file is opend, has been occured.
FR_NOT_ENABLED
FatFs module has not been enabled.
FR_NO_FILESYSTEM
There is no valid FAT partition on the disk.

Description

The f_opendir opens a directory and initializes the DirObject structure for subsequent calls. The directory object structure can be discarded at any time. This function is not supported in minimum configuration.

References

f_readdir, DIR

Return