Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4f9ff7a

Browse files
committedApr 15, 2021
Adjust examples
1 parent 2cc34bd commit 4f9ff7a

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed
 

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
2727
Serial.print(" DIR : ");
2828
Serial.println(file.name());
2929
if(levels){
30-
listDir(fs, file.name(), levels -1);
30+
listDir(fs, file.path(), levels -1);
3131
}
3232
} else {
3333
Serial.print(" FILE: ");

‎libraries/FFat/examples/FFat_time/FFat_time.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
3131
struct tm * tmstruct = localtime(&t);
3232
Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec);
3333
if(levels){
34-
listDir(fs, file.name(), levels -1);
34+
listDir(fs, file.path(), levels -1);
3535
}
3636
} else {
3737
Serial.print(" FILE: ");

‎libraries/LITTLEFS/examples/LITTLEFS_test/LITTLEFS_test.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
3232
Serial.print(" DIR : ");
3333
Serial.println(file.name());
3434
if(levels){
35-
listDir(fs, file.name(), levels -1);
35+
listDir(fs, file.path(), levels -1);
3636
}
3737
} else {
3838
Serial.print(" FILE: ");

‎libraries/LITTLEFS/examples/LITTLEFS_time/LITTLEFS_time.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
4343
struct tm * tmstruct = localtime(&t);
4444
Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec);
4545
if(levels){
46-
listDir(fs, file.name(), levels -1);
46+
listDir(fs, file.path(), levels -1);
4747
}
4848
} else {
4949
Serial.print(" FILE: ");

‎libraries/SD/examples/SD_Test/SD_Test.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
3535
Serial.print(" DIR : ");
3636
Serial.println(file.name());
3737
if(levels){
38-
listDir(fs, file.name(), levels -1);
38+
listDir(fs, file.path(), levels -1);
3939
}
4040
} else {
4141
Serial.print(" FILE: ");

‎libraries/SD/examples/SD_time/SD_time.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
4747
struct tm * tmstruct = localtime(&t);
4848
Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec);
4949
if(levels){
50-
listDir(fs, file.name(), levels -1);
50+
listDir(fs, file.path(), levels -1);
5151
}
5252
} else {
5353
Serial.print(" FILE: ");

‎libraries/SD_MMC/examples/SDMMC_Test/SDMMC_Test.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
3535
Serial.print(" DIR : ");
3636
Serial.println(file.name());
3737
if(levels){
38-
listDir(fs, file.name(), levels -1);
38+
listDir(fs, file.path(), levels -1);
3939
}
4040
} else {
4141
Serial.print(" FILE: ");

‎libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
4747
struct tm * tmstruct = localtime(&t);
4848
Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec);
4949
if(levels){
50-
listDir(fs, file.name(), levels -1);
50+
listDir(fs, file.path(), levels -1);
5151
}
5252
} else {
5353
Serial.print(" FILE: ");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
2525
Serial.print(" DIR : ");
2626
Serial.println(file.name());
2727
if(levels){
28-
listDir(fs, file.name(), levels -1);
28+
listDir(fs, file.path(), levels -1);
2929
}
3030
} else {
3131
Serial.print(" FILE: ");

‎libraries/SPIFFS/examples/SPIFFS_time/SPIFFS_time.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
3131
struct tm * tmstruct = localtime(&t);
3232
Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec);
3333
if(levels){
34-
listDir(fs, file.name(), levels -1);
34+
listDir(fs, file.path(), levels -1);
3535
}
3636
} else {
3737
Serial.print(" FILE: ");

‎libraries/WebServer/examples/FSBrowser/FSBrowser.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void handleFileList() {
207207
output += "{\"type\":\"";
208208
output += (file.isDirectory()) ? "dir" : "file";
209209
output += "\",\"name\":\"";
210-
output += String(file.name()).substring(1);
210+
output += String(file.path()).substring(1);
211211
output += "\"}";
212212
file = root.openNextFile();
213213
}

‎libraries/WebServer/examples/SDWebServer/SDWebServer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void printDirectory() {
229229
output += "{\"type\":\"";
230230
output += (entry.isDirectory()) ? "dir" : "file";
231231
output += "\",\"name\":\"";
232-
output += entry.name();
232+
output += entry.path();
233233
output += "\"";
234234
output += "}";
235235
server.sendContent(output);

0 commit comments

Comments
 (0)
Please sign in to comment.