8000 cp: preserved hardlinks are not reported in --verbose · Issue #6267 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cp: preserved hardlinks are not reported in --verbose #6267

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

Closed
BenWiederhake opened this issue Apr 24, 2024 · 0 comments · Fixed by #6496
Closed

cp: preserved hardlinks are not reported in --verbose #6267

BenWiederhake opened this issue Apr 24, 2024 · 0 comments · Fixed by #6496
Labels

Comments

@BenWiederhake
Copy link
Collaborator

This probably affects other types/modes of copying, too, since we have a lot of shurt-cutting currently.

Steps to reproduce:

  • Have two files that are hardlinks
  • Copy them with -dv to some other directory

Expected behavior: Both files are copied, the resulting two files are hardlinks of each other but not of the original files, and both copy operations are reported.

Actual behavior: Both files are copied, the resulting two files are hardlinks of each other but not of the original files, but only one copy operation is reported.

Demonstrator:

$ ln README.md README.md.hd
$ rm -f target/README.md* && ../gnu/src/cp -dv README.md README.md.hd target/ && ls -i README.md README.md.hd target/README.md target/README.md.hd
'README.md' -> 'target/README.md'
'README.md.hd' -> 'target/README.md.hd'
20093851 README.md  20093851 README.md.hd  20928436 target/README.md  20928436 target/README.md.hd
$ rm -f target/README.md* && cargo run cp -dv README.md README.md.hd target/ && ls -i README.md README.md.hd target/README.md target/README.md.hd
'README.md' -> 'target/README.md'
20093851 README.md  20093851 README.md.hd  20928436 target/README.md  20928436 target/README.md.hd
$

(In this example, the copied files "randomly" got the same inode ID twice in a row, but they might have gotten a different ID in the second run.)

Found while reviewing #6208

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

Successfully merging a pull request may close this issue.

1 participant
0