We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d208a36 commit 17a1a24Copy full SHA for 17a1a24
libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino
@@ -36,7 +36,7 @@ void readFile(fs::FS &fs, const char * path){
36
Serial.printf("Reading file: %s\n", path);
37
38
File file = fs.open(path);
39
- if(!file){
+ if(!file || file.isDirectory()){
40
Serial.println("Failed to open file for reading");
41
return;
42
}
@@ -101,7 +101,7 @@ void testFileIO(fs::FS &fs, const char * path){
101
size_t len = 0;
102
uint32_t start = millis();
103
uint32_t end = start;
104
- if(file){
+ if(file && !file.isDirectory()){
105
len = file.size();
106
size_t flen = len;
107
start = millis();
0 commit comments