f_mkdir

The f_mkdir creates a directory.

FRESULT f_mkdir (
  const char* DirName // Pointer to the directory name
);

Parameter

DirName
Pointer to the null-terminated string that specifies the full-path directory name to create. 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.

Return Value

FR_OK (0)
The function succeeded.
FR_NOPATH
Could not find the path.
FR_INVALID_NAME
The path name is invalid.
FR_DENIED
The function was denied due to any of following reasons: any file or directory that has same name is existing, cannot be created due to the directory table or disk full.
FR_NOT_READY
The disk drive cannot work due to no medium in the drive or any other reason.
FR_WRITE_PROTECTED
The medium is write protected.
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_mkdir creates an empty directory. This function is not supported in read-only and minimum configuration.

Sample Code

    res = f_mkdir("/sub1");
    if (res) die(res);
    res = f_mkdir("/sub1/sub2");
    if (res) die(res);
    res = f_mkdir("/sub1/sub2/sub3");
    if (res) die(res);

Return