Skip to content

Commit 5057d5b

Browse files
committed
Adding seek() and size() functions to SD File class.
1 parent 53f3e8e commit 5057d5b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libraries/SD/File.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ void File::flush() {
5151
SD.file.sync();
5252
}
5353

54+
boolean File::seek(uint32_t pos) {
55+
return SD.file.seekSet(pos);
56+
}
57+
58+
uint32_t File::size() {
59+
return SD.file.fileSize();
60+
}
61+
5462
void File::close() {
5563
SD.file.close();
5664
}

libraries/SD/SD.h

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class File : public Stream {
3333
virtual int peek();
3434
virtual int available();
3535
virtual void flush();
36+
boolean seek(uint32_t pos);
37+
uint32_t size();
3638
void close();
3739
operator bool();
3840
};

0 commit comments

Comments
 (0)