split supports a new --hex-suffixes[=from] option to create files with
lower case hexadecimal suffixes, similar to the --numeric-suffixes option.
+** Improvements
+
+ mv --verbose now distinguishes rename and copy operations.
+
* Noteworthy changes in release 8.27 (2017-03-08) [stable]
/* If the source is a directory, we don't always create the destination
directory. So --verbose should not announce anything until we're
- sure we'll create a directory. */
- if (x->verbose && !S_ISDIR (src_mode))
+ sure we'll create a directory. Also don't announce yet when moving
+ so we can distinguish renames versus copies. */
+ if (x->verbose && !x->move_mode && !S_ISDIR (src_mode))
emit_verbose (src_name, dst_name, backup_succeeded ? dst_backup : NULL);
/* Associate the destination file name with the source device and inode
{
if (rename (src_name, dst_name) == 0)
{
- if (x->verbose && S_ISDIR (src_mode))
- emit_verbose (src_name, dst_name,
- backup_succeeded ? dst_backup : NULL);
+ if (x->verbose)
+ {
+ printf (_("renamed "));
+ emit_verbose (src_name, dst_name,
+ backup_succeeded ? dst_backup : NULL);
+ }
if (x->set_security_context)
{
return false;
}
+ if (x->verbose && !S_ISDIR (src_mode))
+ {
+ printf (_("copied "));
+ emit_verbose (src_name, dst_name,
+ backup_succeeded ? dst_backup : NULL);
+ }
new_dst = true;
}
}
if (x->verbose)
- emit_verbose (src_name, dst_name, NULL);
+ {
+ if (x->move_mode)
+ printf (_("created directory %s\n"), quoteaf (dst_name));
+ else
+ emit_verbose (src_name, dst_name, NULL);
+ }
}
else
{
# Before coreutils-6.2, the " (backup: 'B.~1~')" suffix was not printed.
mv --verbose --backup=numbered -T A B > out || fail=1
cat <<\EOF > exp || fail=1
-'A' -> 'B' (backup: 'B.~1~')
+renamed 'A' -> 'B' (backup: 'B.~1~')
EOF
compare exp out || fail=1
# test miscellaneous combinations of -f -i -n parameters
touch a b || framework_failure_
-echo "'a' -> 'b'" > out_move
+echo "renamed 'a' -> 'b'" > out_move
> out_empty
# ask for overwrite, answer no
# so ignore chatter about when files are removed and copied rather than renamed.
sed "
/^removed /d
+ s,renamed ,,
+ s,copied ,,
s,$other_partition_tmpdir,XXX,
+ s,created directory 'XXX/\(.*\)','\1' -> 'XXX/\1',
" out | sort > out2
cat <<EOF | sort > exp