Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added file.close() in manipulation functions
  • Loading branch information
dstoiko authored Jul 16, 2017
commit ec5fabb69b129291be140998592ea9c0de805824
3 changes: 3 additions & 0 deletions libraries/SD/examples/SD_Test/SD_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ void readFile(fs::FS &fs, const char * path){
while(file.available()){
Serial.write(file.read());
}
file.close();
}

void writeFile(fs::FS &fs, const char * path, const char * message){
Expand All @@ -93,6 +94,7 @@ void writeFile(fs::FS &fs, const char * path, const char * message){
} else {
Serial.println("Write failed");
}
file.close();
}

void appendFile(fs::FS &fs, const char * path, const char * message){
Expand All @@ -108,6 +110,7 @@ void appendFile(fs::FS &fs, const char * path, const char * message){
} else {
Serial.println("Append failed");
}
file.close();
}

void renameFile(fs::FS &fs, const char * path1, const char * path2){
Expand Down