Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 28479

Workaround for SD file creation bug.

$
0
0

There is a bug that does not allow you to create new files on an SD card. This can be fixed by using a Linux system command to create an empty file.

 

  // check if the file exists, if it does not,

  // then create an empty file with that name.

  if(!SD.exists("test.txt")){

    Serial.println("test.txt does not exist, creating.");

    system("touch /media/mmcblk0p1/test.txt");

  }

  // open the file. note that only one file can be open at a time,

  // so you have to close this one before opening another.

  myFile = SD.open("test.txt", FILE_WRITE);


Viewing all articles
Browse latest Browse all 28479

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>