GNU bug report logs -
#69532
mv's new -x option should be made orthogonal to -t/-T/default
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Mon, 4 Mar 2024 00:46:01 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 3/4/24 16:43, Dominique Martinet wrote:
> Adding Rob to the loop because this impacts compatibility with
> toybox/maybe busybox implementations
Busybox does not use RENAME_EXCHANGE, so this isn't a Busybox issue.
Toybox mv added -x to its development version yesterday:
https://github.com/landley/toybox/commit/a2419ad52d489bf1a84a9f3aa73afb351642c765
so there's little prior art there, and there's still plenty of time to
fix its problems before exposing it to the world.
> I also see --swap mostly used by scripts and this actually feels a bit
> dangerous to me -- I'd *always* use this with -T.
Yes, it's a problem.
By "see --swap mostly used by scripts" I assume you mean scripts that
haven't been written yet, assuming that nobody had -x until yesterday....
> (by the way, what's this "rename" command you speak of?
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/
Now that I've looked into it further, util-linux already has an "exch"
command that does exactly what you want. This is the command that toybox
should implement rather than try to simulate it with "mv -x" (which
causes all sorts of problems).
That is, toybox should revert yesterday's change to "mv", and should
implement "exch" instead.
This bug report was last modified 1 year and 152 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.