short option is reserved to better support emulation of the standalone
checksum utilities with cksum.
+ 'mv dir x' now complains differently if x/dir is a nonempty directory.
+ Previously it said "mv: cannot move 'dir' to 'x/dir': Directory not empty",
+ where it was unclear whether 'dir' or 'x/dir' was the problem.
+ Now it says "mv: cannot overwrite 'x/dir': Directory not empty".
+ Similarly for other renames where the destination must be the problem.
+ [problem introduced in coreutils-6.0]
+
** Improvements
cp, mv, and install now avoid copy_file_range on linux kernels before 5.3
If the permissions on the directory containing the source or
destination file are made too restrictive, the rename will
fail. Etc. */
- error (0, rename_errno,
- _("cannot move %s to %s"),
- quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
+ char const *quoted_dst_name = quoteaf_n (1, dst_name);
+ switch (rename_errno)
+ {
+ case EDQUOT: case EEXIST: case EISDIR: case EMLINK:
+ case ENOSPC: case ENOTEMPTY: case ETXTBSY:
+ /* The destination must be the problem. Don't mention
+ the source as that is more likely to confuse the user
+ than be helpful. */
+ error (0, rename_errno, _("cannot overwrite %s"),
+ quoted_dst_name);
+ break;
+
+ default:
+ error (0, rename_errno, _("cannot move %s to %s"),
+ quoteaf_n (0, src_name), quoted_dst_name);
+ break;
+ }
forget_created (src_sb.st_ino, src_sb.st_dev);
return false;
}
sed 's/: Device or resource busy/: Directory not empty/'<out>o1;mv o1 out
cat <<\EOF > exp || framework_failure_
-mv: cannot move 'b/t' to 'a/t': Directory not empty
+mv: cannot overwrite 'a/t': Directory not empty
EOF
compare exp out || fail=1