Added file.close to examples (#3611)

This commit is contained in:
lbernstone 2020-01-20 07:47:40 -07:00 committed by Me No Dev
parent ac9d04a400
commit cd85239252
2 changed files with 6 additions and 0 deletions

View File

@ -52,6 +52,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){
@ -67,6 +68,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){
@ -82,6 +84,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){

View File

@ -50,6 +50,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){
@ -65,6 +66,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){
@ -80,6 +82,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){