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 17a1a24

Browse filesBrowse files
committed
fix SPIFFS example
1 parent d208a36 commit 17a1a24
Copy full SHA for 17a1a24

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void readFile(fs::FS &fs, const char * path){
3636
Serial.printf("Reading file: %s\n", path);
3737

3838
File file = fs.open(path);
39-
if(!file){
39+
if(!file || file.isDirectory()){
4040
Serial.println("Failed to open file for reading");
4141
return;
4242
}
@@ -101,7 +101,7 @@ void testFileIO(fs::FS &fs, const char * path){
101101
size_t len = 0;
102102
uint32_t start = millis();
103103
uint32_t end = start;
104-
if(file){
104+
if(file && !file.isDirectory()){
105105
len = file.size();
106106
size_t flen = len;
107107
start = millis();

0 commit comments

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