@@ -669,29 +669,29 @@ void loop() {
669669}
670670
671671void printDirectory(File dir, int numTabs) {
672- while(true) {
673-
674- File entry = dir.openNextFile();
675- if (! entry) {
676- // No more files
677- // Serial.println("**nomorefiles**");
678- break;
679- }
680-
681- for (uint8_t i= 0; i< numTabs; i++) {
682- Serial.print('\t');
683- }
684-
685- Serial.print(entry.name());
686- if (entry.isDirectory()) {
687- Serial.println("/");
688- printDirectory(entry, numTabs+ 1);
689- } else {
690- // Files have sizes, directories do not
691- Serial.print("\t\t");
692- Serial.println(entry.size(), DEC);
693- }
694- }
672+ while (true) {
673+
674+ File entry = dir.openNextFile();
675+ if (!entry) {
676+ // No more files
677+ // Serial.println("**nomorefiles**");
678+ break;
679+ }
680+
681+ for (uint8_t i = 0; i < numTabs; i++) {
682+ Serial.print('\t');
683+ }
684+
685+ Serial.print(entry.name());
686+ if (entry.isDirectory()) {
687+ Serial.println("/");
688+ printDirectory(entry, numTabs + 1);
689+ } else {
690+ // Files have sizes, directories do not
691+ Serial.print("\t\t");
692+ Serial.println(entry.size(), DEC);
693+ }
694+ }
695695}
696696```
697697
@@ -745,7 +745,7 @@ void setup() {
745745 delay(2000);
746746
747747 Serial.println();
748- Serial.println("Rewinding, and repeating below:" );
748+ Serial.println("Rewinding, and repeating below:");
749749 Serial.println();
750750 delay(2000);
751751
@@ -761,7 +761,7 @@ void loop() {
761761void printDirectory(File dir, int numTabs) {
762762 while (true) {
763763 File entry = dir.openNextFile();
764- if (! entry) {
764+ if (!entry) {
765765 if (numTabs == 0)
766766 Serial.println("** Done **");
767767 return;
@@ -841,29 +841,29 @@ void loop() {
841841}
842842
843843void printDirectory(File dir, int numTabs) {
844- while(true) {
845- File entry = dir.openNextFile();
846- if (! entry) {
847- // No more files
848- // Return to the first file in the directory
849- dir.rewindDirectory();
850- break;
851- }
852-
853- for (uint8_t i= 0; i< numTabs; i++) {
854- Serial.print('\t');
855- }
856-
857- Serial.print(entry.name());
858- if (entry.isDirectory()) {
859- Serial.println("/");
860- printDirectory(entry, numTabs+ 1);
861- } else {
862- // Files have sizes, directories do not
863- Serial.print("\t\t");
864- Serial.println(entry.size(), DEC);
865- }
866- }
844+ while (true) {
845+ File entry = dir.openNextFile();
846+ if (!entry) {
847+ // No more files
848+ // Return to the first file in the directory
849+ dir.rewindDirectory();
850+ break;
851+ }
852+
853+ for (uint8_t i = 0; i < numTabs; i++) {
854+ Serial.print('\t');
855+ }
856+
857+ Serial.print(entry.name());
858+ if (entry.isDirectory()) {
859+ Serial.println("/");
860+ printDirectory(entry, numTabs + 1);
861+ } else {
862+ // Files have sizes, directories do not
863+ Serial.print("\t\t");
864+ Serial.println(entry.size(), DEC);
865+ }
866+ }
867867}
868868```
869869
0 commit comments