I'm trying out various functions of the SD library (v 1.3.0). The documentation says I can create a new directory incl. a number of parent directories if they don't already exist.
https://docs.arduino.cc/libraries/sd/, go to the mkdir() example:
SD.mkdir("a/b/c") will create a, b, and c...
I tried:
createDir(SD, "/mydir1/mydir2/mydir3");
listDir(SD, "/", 3);
using function
bool createDir(fs::FS &fs, const char * path) {
Serial.printf("Creating Dir: %s\n", path);
if(fs.mkdir(path)){
Serial.println("Dir created");
return true;
} else {
Serial.println("mkdir failed");
return false;
}
}
and createDIr always returns "mkdir failed".
When I try to create those 3 directories in 3 steps, one dir at a time, it works.
Is this a bug or is the doc incorrect?