From d8330cceecddfe4b74a8962c8656e97d5c6219d2 Mon Sep 17 00:00:00 2001 From: dstoiko Date: Mon, 17 Jul 2017 08:44:04 +0800 Subject: [PATCH] Added file.close() in manipulation functions (#514) --- libraries/SD/examples/SD_Test/SD_Test.ino | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/SD/examples/SD_Test/SD_Test.ino b/libraries/SD/examples/SD_Test/SD_Test.ino index 8e388423..69c59766 100644 --- a/libraries/SD/examples/SD_Test/SD_Test.ino +++ b/libraries/SD/examples/SD_Test/SD_Test.ino @@ -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){ @@ -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){ @@ -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){