1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Redoing peek() implementation (SD file class).

Now simply seeking backwards by a character in peek() rather than trying to keep track of the extra character read.
This commit is contained in:
David A. Mellis
2010-12-22 16:47:50 -06:00
parent a7a8f3fa10
commit 575bb1dafb
4 changed files with 7 additions and 22 deletions

View File

@ -13,7 +13,7 @@ void setup()
if (!b) goto done;
ATS_PrintTestStatus("!SD.exists()", !SD.exists("asdf.txt"));
ATS_PrintTestStatus("SD.open()", f = SD.open("asdf.txt", FILE_TRUNCATE)); f.close();
ATS_PrintTestStatus("SD.open()", f = SD.open("asdf.txt", FILE_WRITE)); f.close();
ATS_PrintTestStatus("SD.exists()", SD.exists("asdf.txt"));
ATS_PrintTestStatus("SD.exists()", SD.exists("/asdf.txt"));
ATS_PrintTestStatus("SD.remove()", SD.remove("asdf.txt"));
@ -48,13 +48,13 @@ void setup()
ATS_PrintTestStatus("!SD.exists()", !SD.exists("x/y"));
ATS_PrintTestStatus("!SD.exists()", !SD.exists("x/y/z"));
ATS_PrintTestStatus("!SD.open()", !(f = SD.open("asdf/asdf.txt", FILE_TRUNCATE))); f.close();
ATS_PrintTestStatus("!SD.open()", !(f = SD.open("asdf/asdf.txt", FILE_WRITE))); f.close();
ATS_PrintTestStatus("!SD.exists()", !SD.exists("asdf"));
ATS_PrintTestStatus("!SD.exists()", !SD.exists("asdf.txt"));
ATS_PrintTestStatus("!SD.exists()", !SD.exists("asdf/asdf.txt"));
ATS_PrintTestStatus("SD.mkdir()", SD.mkdir("asdf"));
ATS_PrintTestStatus("SD.exists()", SD.exists("asdf"));
ATS_PrintTestStatus("SD.open()", f = SD.open("asdf/asdf.txt", FILE_TRUNCATE)); f.close();
ATS_PrintTestStatus("SD.open()", f = SD.open("asdf/asdf.txt", FILE_WRITE)); f.close();
ATS_PrintTestStatus("SD.exists()", SD.exists("asdf/asdf.txt"));
ATS_PrintTestStatus("!SD.rmdir()", !SD.rmdir("asdf"));
ATS_PrintTestStatus("SD.exists()", SD.exists("asdf"));