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

New method Dir::sync #5

Merged
merged 1 commit into from
Dec 12, 2023
Merged

New method Dir::sync #5

merged 1 commit into from
Dec 12, 2023

Conversation

zackw
Copy link

@zackw zackw commented Dec 12, 2023

It calls fsync() on the file descriptor. This is necessary with some operating systems and/or file systems to ensure that changes to the contents of the directory make it to persistent storage — for the same reason it is sometimes necessary to use std::fs::File::sync_{all,contents}.

Note that this method will fail if used on a Dir opened with O_PATH. (Same issue as list_dir; see tailhook#34.)

Closes tailhook#47.

It calls fsync() on the file descriptor.  This is necessary with some
operating systems and/or file systems to ensure that changes to the
contents of the directory make it to persistent storage — for the same
reason it is sometimes necessary to use `std::fs::File::sync_{all,contents}`.

Note that this method will fail if used on a `Dir` opened with `O_PATH`.
(Same issue as `list_dir`; see tailhook#34.)

Closes tailhook#47.
@zackw
Copy link
Author

zackw commented Dec 12, 2023

@cehteh FYI, I would be interested in helping out with this crate more broadly. I see a lot of places I could supply some polish.

@cehteh
Copy link
Owner

cehteh commented Dec 12, 2023

@cehteh FYI, I would be interested in helping out with this crate more broadly. I see a lot of places I could supply some polish.

You'll be welcome. I am currently busy with other things but I have some plans to improve this crate in future. Meanwhile I like help and PR adding such features.

@cehteh cehteh merged commit e054d63 into cehteh:master Dec 12, 2023
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

Successfully merging this pull request may close these issues.

The fd in a Dir object cannot be used with fsync()
2 participants