1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-01 23:29:28 +01:00

Adding seek() and size() functions to SD File class.

This commit is contained in:
David A. Mellis 2010-12-22 15:11:54 -06:00
parent 53f3e8ef92
commit 5057d5b109
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,14 @@ void File::flush() {
SD.file.sync(); SD.file.sync();
} }
boolean File::seek(uint32_t pos) {
return SD.file.seekSet(pos);
}
uint32_t File::size() {
return SD.file.fileSize();
}
void File::close() { void File::close() {
SD.file.close(); SD.file.close();
} }

View File

@ -33,6 +33,8 @@ public:
virtual int peek(); virtual int peek();
virtual int available(); virtual int available();
virtual void flush(); virtual void flush();
boolean seek(uint32_t pos);
uint32_t size();
void close(); void close();
operator bool(); operator bool();
}; };