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

mv: fails to create dir when missing read permissions #6684

Open
BenWiederhake opened this issue Sep 7, 2024 · 0 comments
Open

mv: fails to create dir when missing read permissions #6684

BenWiederhake opened this issue Sep 7, 2024 · 0 comments
Labels

Comments

@BenWiederhake
Copy link
Collaborator

When moving a dir to a different filesystem, GNU mv first creates a new dir, and then bails out, leaving behind an empty dir:

$ rm -rf /tmp/foobar/ && mv -v /root/ /tmp/foobar
created directory '/tmp/foobar'
mv: cannot access '/root/': Permission denied
[$? = 1]
$ file /tmp/foobar
/tmp/foobar: directory

We currently don't:

$ rm -rf /tmp/foobar/ && cargo run -q --features mv mv -v /root/ /tmp/foobar
mv: Permission denied
[$? = 1]
$ file /tmp/foobar
/tmp/foobar: cannot open `/tmp/foobar' (No such file or directory)

Found while reviewing #6632.

Also: That error message is uninformative. Which permission was denied? When accessing which file? Is the permission problem with the source or with the destination? I hope you can see how this error message might be confusing when there's many files being moved/copied. However, this might be fixed by #6632.

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

No branches or pull requests

2 participants