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
Message #82 received at 69532 <at> debbugs.gnu.org (full text, mbox):
On 3/21/24 00:56, Paul Eggert wrote:
> On 3/20/24 15:53, Bernhard Voelker wrote:
> Yes, that's the expected behavior for this contrived case. Just as one
> would get odd behavior if one did the same thing without --exchange.
There's another which is not consistent with/without --exchange:
$ src/mv -v a a
src/mv: 'a' and 'a' are the same file
$ src/mv -v --exchange a a
renamed 'a' -> 'a'
RENAME_EXCHANGE is allowed (but useless?) for 1 file.
BTW: shouldn't the -v diagnostic better say "exchanged 'a' <-> 'a'"
because that's what happened?
>> - not sure if exchange works well together with -f.
>
> What problems do you see there?
it's up to the tests to proof that.
>> why does exchange not work to exchange a regular with a
>> directory file?
>
> It works. I don't see a problem there.
>
> $ touch a
> $ mkdir d
> $ ./mv -T --exchange a d
> $ ls -ld a d
> drwxr-xr-x. 2 eggert eggert 4096 Mar 20 16:52 a
> -rw-r--r--. 1 eggert eggert 0 Mar 20 16:52 d
indeed, it works. It seems my test was wrong, sorry.
>> Finally, the test cases are very sparse:
>
> Feel free to add some. :-)
Unfortunately, I cannot currently spend as much time as I'd love to.
It seems that -i is skipped:
$ src/mv -iv --exchange a b
renamed 'a' -> 'b'
As far as I know Padraig would like to do the next release very soon,
so I would recommend to not hurrying this one into it, and instead
ironing all out after the release.
Have a nice day,
Berny
This bug report was last modified 1 year and 153 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.