0

So I'm trying to create a new file that has underscores in its name. However, when I try this, no file is created.

This works

String fileName = "NMEA.txt";
mySensorData = SD.open(fileName.c_str(), FILE_WRITE); 

This does not work

String fileName = "NMEA__23_33_3__16_7_29.txt";
mySensorData = SD.open(fileName.c_str(), FILE_WRITE); 

Does anyone know why?

1 Answer 1

3

[The SD library] uses short 8.3 names for files.

source

3
  • Do you have any tips on how I can organize my files then? As you can see in the above format, I have it as NMEA__hr_mn_ss__yr_mm_dd.txt.
    – jlcv
    Commented Jul 30, 2016 at 0:21
  • I tried String fileName = "/23_33_3/16_7_29/NMEA.txt" to organize it by directory and it doesn't seem to create them.
    – jlcv
    Commented Jul 30, 2016 at 0:22
  • Have you actually created those directories? It won't magically make them for you...
    – Majenko
    Commented Jul 30, 2016 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.