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

copy or move over hard link to same file, destroys both #805

Open
db-inf opened this issue Oct 14, 2022 · 0 comments
Open

copy or move over hard link to same file, destroys both #805

db-inf opened this issue Oct 14, 2022 · 0 comments

Comments

@db-inf
Copy link

db-inf commented Oct 14, 2022

Say you have a file foo/myfile and a file bar/myfile, which are hard linked to the same inode (e.g. with the command ln foo/myfile bar.). If you mv foo/myfile bar/myfile or cp foo/myfile bar/myfile in a terminal, you get an error message mv: 'foo/myfile' and 'bar/myfile' are the same file, and similarly for the copy.

SpaceFM, either when dragging myfile from foo/ to bar/ (for move, or with [Ctrl] down for copy), or via the clipboard with [Ctrl]+x or [Ctrl]+c followed by [Ctrl]+v, pops up a confirmation dialog, stating that both files are the same size and timestamp, but does not mention they are the same file. If you confirm the move or copy, both foo/myfile and bar/myfile are truncated to 0 bytes.

Note: the tests were performed on a tmpfs file system.

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

1 participant