Skip to content

Commit

Permalink
Add File truncate(size)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Nov 17, 2020
1 parent 8ad7ce6 commit 36bfbd1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions teensy/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class File : public Stream {
virtual void flush() {
if (f) f->flush();
}
virtual bool truncate(uint64_t size=0) {
return (f) ? f->truncate(size) : false;
}
virtual bool seek(uint64_t pos, int mode) {
return (f) ? f->seek(pos, mode) : false;
}
Expand Down
3 changes: 3 additions & 0 deletions teensy3/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class File : public Stream {
virtual void flush() {
if (f) f->flush();
}
virtual bool truncate(uint64_t size=0) {
return (f) ? f->truncate(size) : false;
}
virtual bool seek(uint64_t pos, int mode) {
return (f) ? f->seek(pos, mode) : false;
}
Expand Down
3 changes: 3 additions & 0 deletions teensy4/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class File : public Stream {
virtual void flush() {
if (f) f->flush();
}
virtual bool truncate(uint64_t size=0) {
return (f) ? f->truncate(size) : false;
}
virtual bool seek(uint64_t pos, int mode) {
return (f) ? f->seek(pos, mode) : false;
}
Expand Down

0 comments on commit 36bfbd1

Please sign in to comment.