Skip to content

Commit fc2bdc8

Browse files
committed
Fix Full.ino test directory
It is possible to use only a File without open it but in this case boolean test should not be used as the file is not opened. Moreover, in this case the close should be called to freed dynamic allocated name. Fix #12 Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 2f7d34a commit fc2bdc8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: examples/Full/Full.ino

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,14 @@ void setup()
157157
}
158158

159159
/* Test isDirectory() method */
160-
MyFile = File("STM32");
160+
MyFile = SD.open("STM32");
161161
if (MyFile) {
162162
Serial.print("Is 'STM32' is a dir: ");
163163
if (MyFile.isDirectory())
164164
Serial.println("OK");
165165
else
166166
Serial.println("KO");
167+
MyFile.close();
167168
} else {
168169
Serial.println("Error to open 'STM32' dir");
169170
}

0 commit comments

Comments
 (0)