Summary: | sys-apps/coreutils mv behavior with hard links to same file | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Xuefer <xuefer> |
Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | floppym |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Xuefer
2017-08-14 04:14:38 UTC
POSIX says this behavior is correct. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/mv.html "The specification ensures that mv a a will not alter the contents of file a, and allows the implementation to issue an error that a file cannot be moved onto itself. Likewise, when a and b are hard links to the same file, mv a b will not alter b, but if a diagnostic is not issued, then it is unspecified whether a is left untouched (as it would be by the rename() function) or unlinked (reducing the link count of b)." |