-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Description
When writing file sync tools, it would be nice if the files put on a micropython board could be updated with their original timestamp (via os.utime). So sync tools could check the file date to determine if a file needs to be changed or is already up-to-date. (A more precise check can be made with actually inspecting the file contents, but for simple and quick syncs, the date is preferable).
Currently it is only possible to create new files that will get the "current time" which is a more or less random value near 1970 or 1985, as the clocks of those boards are usually not set and not battery backed up.
I see the FAT driver already has a f_utime()
function, so adding this one should be easy (I might provide a pull request with a basic implementation e.g. times in seconds not ns, if desired).