Skip to content

Commit 0a425cb

Browse files
committed
Add rewindDirectory()
1 parent f4f6ffe commit 0a425cb

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

ArduinoCore-Linux/libraries/SD.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,17 @@ class File : public Stream {
179179

180180
const char *name() { return filename.c_str(); }
181181

182+
void rewindDirectory() {
183+
if (!is_dir) return;
184+
#ifdef USE_FILESYSTEM
185+
try {
186+
iterator = std::filesystem::directory_iterator(dir_path);
187+
} catch (...) {
188+
// Handle errors silently
189+
}
190+
#endif
191+
}
192+
182193
protected:
183194
std::fstream file;
184195
size_t size_bytes = 0;

ArduinoCore-Linux/libraries/SdFat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class SdFat {
7474
struct stat info;
7575
return stat(name, &info) == 0;
7676
}
77+
void end(){}
7778
};
7879
/**
7980
* @brief C++ std based emulatoion ofr SdFile

0 commit comments

Comments
 (0)