diff options
author | Robert HH <robert@hammelrath.com> | 2016-06-16 18:17:59 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-06-16 19:31:58 +0300 |
commit | 23067a14223a1d142db28edae9dead79626e056b (patch) | |
tree | 4f240c5e589de13ee2db924862145cfa2f7ff2ca /extmod/vfs_fat.c | |
parent | d0416ff9158de23df9b916801ec3d27d85403c00 (diff) |
esp8266: Use RTC to set date & time stamps for files.
The time stamp is taken from the RTC for all newly generated
or changed files. RTC must be maintained separately.
The dummy time stamp of Jan 1, 2000 is set in vfs.stat() for the
root directory, avoiding invalid time values.
Diffstat (limited to 'extmod/vfs_fat.c')
-rw-r--r-- | extmod/vfs_fat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index a4a81370f..df5cbb0d6 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -186,7 +186,7 @@ STATIC mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) { if (path_equal(path, "/")) { // stat root directory fno.fsize = 0; - fno.fdate = 0; + fno.fdate = 0x2821; // Jan 1, 2000 fno.ftime = 0; fno.fattrib = AM_DIR; } else { @@ -196,7 +196,7 @@ STATIC mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) { if (vfs != NULL && path_equal(path, vfs->str)) { // stat mounted device directory fno.fsize = 0; - fno.fdate = 0; + fno.fdate = 0x2821; // Jan 1, 2000 fno.ftime = 0; fno.fattrib = AM_DIR; res = FR_OK; |