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

Add tokio::fs::exists #3373

Closed
Darksonn opened this issue Jan 4, 2021 · 0 comments · Fixed by #4299
Closed

Add tokio::fs::exists #3373

Darksonn opened this issue Jan 4, 2021 · 0 comments · Fixed by #4299
Labels
A-tokio Area: The main tokio crate E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. M-fs Module: tokio/fs

Comments

@Darksonn
Copy link
Contributor

Darksonn commented Jan 4, 2021

Note that std implements exists as the following, so you can already do this by calling metadata, however we should still add the method.

pub fn exists(&self) -> bool {
    fs::metadata(self).is_ok()
}
@Darksonn Darksonn added E-help-wanted Call for participation: Help is requested to fix this issue. E-easy Call for participation: Experience needed to fix: Easy / not much A-tokio Area: The main tokio crate M-fs Module: tokio/fs labels Jan 4, 2021
ranile added a commit to ranile/tokio that referenced this issue Jan 4, 2021
ranile added a commit to ranile/tokio that referenced this issue Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. M-fs Module: tokio/fs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant