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 remove apis #16

Merged
merged 1 commit into from
Mar 6, 2020
Merged

Add remove apis #16

merged 1 commit into from
Mar 6, 2020

Conversation

andrewhickman
Copy link
Owner

Closes #11

P: AsRef<Path> + Into<PathBuf>,
{
fs::remove_dir_all(path.as_ref())
.map_err(|source| Error::new(source, ErrorKind::RemoveDir, path))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we need to pull the directory traversal into this crate? If we invoke fs::remove_dir_all, then if there's a permission error removing a deeply-nested file, fs-err will falsely report the permission error as stemming from the root path.

For API coverage purposes, it might be enough to start with this approach.

Copy link
Owner Author

@andrewhickman andrewhickman Mar 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had a go at this. Unfortunately the standard library implementation on windows uses the unstable FileTypeExt::is_symlink_dir. I've created #17 to track that

@andrewhickman andrewhickman merged commit 9fcb40e into master Mar 6, 2020
@LPGhatguy
Copy link
Collaborator

Ope, we forgot to add a changelog entry!

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.

fs::remove APIs
2 participants