SD card library

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?

There's a similar discussion here:

But as you don't say which board you are using, I don't know how relevant it will be to your situation.

I'm also using ESP32.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.