Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cd85239

Browse filesBrowse files
lbernstoneme-no-dev
authored andcommitted
Added file.close to examples (espressif#3611)
1 parent ac9d04a commit cd85239
Copy full SHA for cd85239

File tree

2 files changed

+6
-0
lines changed
Filter options

2 files changed

+6
-0
lines changed

‎libraries/FFat/examples/FFat_Test/FFat_Test.ino

Copy file name to clipboardExpand all lines: libraries/FFat/examples/FFat_Test/FFat_Test.ino
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ void readFile(fs::FS &fs, const char * path){
5252
while(file.available()){
5353
Serial.write(file.read());
5454
}
55+
file.close();
5556
}
5657

5758
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){
6768
} else {
6869
Serial.println("- write failed");
6970
}
71+
file.close();
7072
}
7173

7274
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){
8284
} else {
8385
Serial.println("- append failed");
8486
}
87+
file.close();
8588
}
8689

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

‎libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino

Copy file name to clipboardExpand all lines: libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ void readFile(fs::FS &fs, const char * path){
5050
while(file.available()){
5151
Serial.write(file.read());
5252
}
53+
file.close();
5354
}
5455

5556
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){
6566
} else {
6667
Serial.println("- write failed");
6768
}
69+
file.close();
6870
}
6971

7072
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){
8082
} else {
8183
Serial.println("- append failed");
8284
}
85+
file.close();
8386
}
8487

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.