[plug] mv (move) problem/bug

Timothy White weirdo at tigris.org
Fri Jan 14 10:14:15 WST 2005


I appear to have found a bug in mv. Ether that I am not understanding
the behaviour.
This works with multiple versions with the latest I've tried being 5.0.91.
Basically I have a script that needs to call mv to move a file IF the
file doesn't exist in the destination.
I use 'mv --reply=no' and 'mv -i --reply=no' and it still overwrites the
existing file.

Am I doing something wrong? I've tried setting noclobber under bash but
it still happens.

I'm thinking that this is a bug or a case of the behaviour being
different from expected. I've not yet googled or tried updating
coreutils (Debian Testing) so I'll try that but it does appear to be a
bug. I'm going to look for the src code as well.

Tim

Ex 1:
$ dd if=/dev/urandom of=src_file count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.002098 seconds (244040 bytes/sec)
$ dd if=/dev/urandom of=dest_file count=10
10+0 records in
10+0 records out
5120 bytes transferred in 0.005198 seconds (984994 bytes/sec)
$ vdir src_file dest_file
-rw-r-----    1 tim      tim          5120 Jan 14 10:12 dest_file
-rw-r-----    1 tim      tim           512 Jan 14 10:12 src_file
$ mv -i --reply=no src_file dest_file
$ vdir src_file dest_file
vdir: srv_file: No such file or directory
-rw-r-----    1 tim      tim           512 Jan 14 10:12 dest_file

--
Tim White - Use the Fox, Luke!
PGP/GPG id: 602E944D, Pub Key Serv: subkeys.pgp.net
Fingerprint: 04C2 9682 B7B2 3006 009D  A9F3 067E EDCD 602E 944D
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
--

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20050114/74af23b4/attachment.pgp>


More information about the plug mailing list