Skip to content

os.utime is missing #2762

@zsquareplusc

Description

@zsquareplusc

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementationsneeds-infoThis issue needs more information to be resolvable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions