forked from esp8266/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fileCreation/getCreation create-time accessors (esp8266#7000)
* Add fileCreation/getCreation create-time accessors For SDFS and LittleFS, enable a creation time accessor for files and Dir iterators, similar to the existing fileTime/getLastWrite calls. Remove spurious Dir::getLastWrite method (the proper and only documented way is really Dir::fileTime). Update json to point to new mklittlefs which copies the creation date of files to the image. Fixes esp8266#6992 * Remove malloc(), use stack vars for temp names LFS filenames are limited in size and generally very small. Use a stack variable instead of a dynamic allocation when performing full-path computations. * Replace "Creation" w/"CreationTime" in FS accessor Per review, `getCreation` -> `getCreationTime`, `fileCreation` -> `fileCreationTime`. The names `fileTime()` and `getLastWrite()` are inherited from ESP32 implementation and unchanged. * Add creation time to listfiles SD example * Enable SdFat's sateTime callback for timestamping SdFat requries the dateTimeCallback call (global for everything) to update dates and times on created files. Because the callback signature doesn't have space for us to provide any parameters, we cannot get the the File, Dir, or FS object's dateTimeCB member. Instead, just go with `time(null)` as the callback function which is right in all but the most esoteric cases. * Correct DOS year/month offset in dateTime callback * Fix docs to match new xxxCreationTime() API names Co-authored-by: Develo <[email protected]>
- Loading branch information
1 parent
4eca62c
commit bea64df
Showing
10 changed files
with
176 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.