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

Method for moving files/dirs #9

Closed
io12 opened this issue Aug 6, 2020 · 2 comments
Closed

Method for moving files/dirs #9

io12 opened this issue Aug 6, 2020 · 2 comments

Comments

@io12
Copy link

io12 commented Aug 6, 2020

It doesn't look like there's any method for moving/renaming files and directories currently. You can delete and recreate files/dirs, but the performance of this can be bad for large files/dirs.

@manuel-woelker
Copy link
Owner

Good point, for moves on the same filesystems there should probably be an optimization to actually call rename(2) and let the kernel do the heavy lifting. Thanks for the feedback, I will look into it.

@manuel-woelker
Copy link
Owner

Added in the latest release (0.4.0). For physical filesystems this should get lowered to syscalls where available.

https://docs.rs/vfs/0.4.0/vfs/path/struct.VfsPath.html#method.copy_file

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

2 participants