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
There is no specific function to change only the atime for links. It could be nice if set_times was public, as this may be the only function you need. But when using set_symlink_file_times you must first get the current link metadata, which is also inefficient, and then change both the mtime and the atime, providing the one you don't want to change from the metadata. Specific functions like set_file_atime provide a None to the relevant FileTime in set_times, which then converts it to an OS-specific UTIME_OMIT for the system call or whatever in Windows. Unlike in Windows implementation's set_file_handle_times corresponding function, though, which does accept Option<FileTime> and is public, in Linux using set_times sin't an option.
When I try to set atime only by providing mtime from the original link's metadata with set_symlink_file_times, the link's 'atime' becomes the current system time on Debian 12 x86-64 default ext4 filesystem. It works well for me the other way round, though, I am not sure why.
Proposed solutions:
Add specific set_symlink_file_atime and set_symlink_file_mtime to both Windows and Linux implementations.
Remove the set_symlink_file_times entirely and add a flag like follow_links to the normal file functions like set_file_atime.
Make set_times public, like the set_file_handle_times in Windows.
The text was updated successfully, but these errors were encountered:
There is no specific function to change only the
atime
for links. It could be nice ifset_times
was public, as this may be the only function you need. But when usingset_symlink_file_times
you must first get the current link metadata, which is also inefficient, and then change both themtime
and theatime
, providing the one you don't want to change from the metadata. Specific functions likeset_file_atime
provide aNone
to the relevantFileTime
inset_times
, which then converts it to an OS-specificUTIME_OMIT
for the system call or whatever in Windows. Unlike in Windows implementation'sset_file_handle_times
corresponding function, though, which does acceptOption<FileTime>
and is public, in Linux usingset_times
sin't an option.When I try to set
atime
only by providingmtime
from the original link's metadata withset_symlink_file_times
, the link's 'atime' becomes the current system time on Debian 12 x86-64 default ext4 filesystem. It works well for me the other way round, though, I am not sure why.Proposed solutions:
set_symlink_file_atime
andset_symlink_file_mtime
to both Windows and Linux implementations.set_symlink_file_times
entirely and add a flag likefollow_links
to the normal file functions likeset_file_atime
.set_times
public, like theset_file_handle_times
in Windows.The text was updated successfully, but these errors were encountered: