You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some OS/filesystem combos support file birth/creation times as a user-modifiable attribute. Windows and macOS, at least, are in this boat, and possibly also FreeBSD and NetBSD.
Windows: Supported by the SetFileTime API already in use by filetime.
BSDs: Supported by timensat/futimens under FreeBSD/NetBSD, though apparently not by OpenBSD. Requires some date logic which I'm having trouble wrapping my head around, and two syscalls.
I see the from_creation_time logic in src/unix/mod.rs only supports FreeBSD and OpenBSD, so I assume the NetBSD limitation is known.
Other OSes: ??? Probably not Android, since it's Linux-based. I haven't looked into Solaris/Illumos/Haiku/Redox.
Although Linux added support for reading btimes with statx in 4.11, they seem to have decided that it is only for internal filesystem use, and thus should not be settable by normal means. There was a proposal to come up with a standard xattr for logical file creation time, but I haven't been able to find any info on whether that ever happened.
If this is acceptable, what should the API look like? I could just add a btime parameter to all of the set_file_times/set_file_handle_times methods, and then return an io::Error or panic for unimplemented platforms.
The text was updated successfully, but these errors were encountered:
Sorry I don't know enough about btime and various other bits and pieces to know best how to bind the API. If it can be set all at once on some platforms though it seems reasonable to have a function that takes all the parameters though.
Some OS/filesystem combos support file birth/creation times as a user-modifiable attribute. Windows and macOS, at least, are in this boat, and possibly also FreeBSD and NetBSD.
SetFileTime
API already in use by filetime.utimensat
/futimens
, but supported bysetattrlist
.timensat
/futimens
under FreeBSD/NetBSD, though apparently not by OpenBSD. Requires some date logic which I'm having trouble wrapping my head around, and two syscalls.from_creation_time
logic in src/unix/mod.rs only supports FreeBSD and OpenBSD, so I assume the NetBSD limitation is known.Although Linux added support for reading
btime
s withstatx
in 4.11, they seem to have decided that it is only for internal filesystem use, and thus should not be settable by normal means. There was a proposal to come up with a standard xattr for logical file creation time, but I haven't been able to find any info on whether that ever happened.If this is acceptable, what should the API look like? I could just add a
btime
parameter to all of theset_file_times
/set_file_handle_times
methods, and then return anio::Error
or panic for unimplemented platforms.The text was updated successfully, but these errors were encountered: