Unverified Commit 6c22ea3b authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Set creation time on LittleFS directory creation (#2108)

parent 1be28b55
......@@ -157,6 +157,14 @@ public:
return false;
}
int rc = lfs_mkdir(&_lfs, path);
if ((rc == 0) && _timeCallback) {
time_t now = _timeCallback();
// Add metadata with creation time to the directory marker
int rc = lfs_setattr(&_lfs, path, 'c', (const void *)&now, sizeof(now));
if (rc < 0) {
DEBUGV("Unable to set creation time on '%s' to %ld\n", path, (long)now);
}
}
return (rc == 0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment