Skip to content

cp: when copying hardlink over itself, the backup should also be a hardlink #6532

@BenWiederhake

Description

@BenWiederhake

When copying hardlink over itself, the backup should also be a hardlink, and its creation announced if -v was given.

$ rm -f README.md~ && cp -vlbf README.md README.md && ls -1i README.md*
'README.md' -> 'README.md~'
20092600 README.md
20092600 README.md~
$ rm -f README.md~ && cargo run -q cp -vlbf README.md README.md && ls -1i README.md*
20092600 README.md
20074037 README.md~

Found while reading #6496, but only remotely related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions