Skip to content

mv shouldn't delete directory before it's moved/copied entirely #7933

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

Open
GZGavinZhao opened this issue May 14, 2025 · 1 comment
Open

mv shouldn't delete directory before it's moved/copied entirely #7933

GZGavinZhao opened this issue May 14, 2025 · 1 comment
Labels

Comments

@GZGavinZhao
Copy link

This only applies when mv-ing directories across different filesystems.

According to this StackOverflow post, in particular user263131's command, if I run (coreutils) mv /mnt/fs1/foo /mnt/fs2/ and I interrupt before the command is completed, the contents of /mnt/fs1/foo should stay unchanged. However, this is not behavior of uutils mv. To repro,

mkdir test
dd if=/dev/zero of=test/a bs=1M count=100
dd if=/dev/zero of=test/b bs=1M count=100
dd if=/dev/zero of=test/c bs=1M count=100
dd if=/dev/zero of=test/d bs=1M count=100
mv -g test /mnt/fs1/

Watch the progress bar and Ctrl+C after one file is moved. You will see that test only contains 3 files now. However, the behavior of mv is that all 4 files remain. You can verify this by running (coreutils) mv -v test /mnt/fs1 and Ctrl+C after one file is copied. All files in test are preserved.

@hz2
Copy link
Contributor

hz2 commented May 14, 2025

I can try taking a look into this

hz2 added a commit to hz2/coreutils that referenced this issue May 16, 2025
currently fails, as expected
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

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy