Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make set_times public #95

Open
tertsdiepraam opened this issue Mar 17, 2023 · 0 comments
Open

Make set_times public #95

tertsdiepraam opened this issue Mar 17, 2023 · 0 comments

Comments

@tertsdiepraam
Copy link

Hi! I have a use case1 where both the atime and mtime are optional and where following the symlink is optional. While looking through the source code of this crate, I found this function in the unix-specific part of the library, which fits my use case perfectly, but it's not public:

fn set_times(
p: &Path,
atime: Option<FileTime>,
mtime: Option<FileTime>,
symlink: bool,
) -> io::Result<()> {

Similar functions do not yet exist for the Windows and Redox implementations, but I think those could be added with relatively little effort.

If you decide to expose this, I'd recommend a name like set_path_times, mirroring the set_file_handle_times name, which is very similar in functionality. I would be happy to open a PR for this.

This would also partially fix #83, albeit not in the most elegant way.

Footnotes

  1. The touch utility of uutils, which basically acts as a wrapper around the utimensat syscall and therefore requires the same flexibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant