[BusyBox] Problem with MV not checking file availability

Jason.Schoon at intermec.com Jason.Schoon at intermec.com
Wed Jul 28 16:05:43 UTC 2004


Okay, there is one other interesting twist to this.  It only appears to
happen when I cross mount points.

I have 3 main file systems on my device right now.  A root file system using
SquashFS, a secondary partition running JFFS2, and a temp file system
running tmpfs.  Here are some examples:


This test works correctly
----------------------------
/secondary # echo date > foo
/secondary # ls
conf	test
/secondary # ls conf
/secondary # mv conf/foo foo
Mv: unable to rename 'conf/foo': No such file or directory
/secondary # ls
conf foo test


This test fails
----------------------------
/secondary # echo date > foo
/secondary # ls
conf	test
/secondary # ls /tmp
/secondary # mv /tmp/foo foo
Mv: /tmp/foo: No such file or directory
/secondary # ls
conf test


This behaves the same regardless if I create the file on the tmpfs or JFFS2
partitions, so I don't think it is a filesystem issue.


-Jason


On Tue, 27 Jul 2004 2:20pm  -0500, Jason.Schoon at intermec.com wrote:

> If I accidentally attempt to move a non-existent file from a directory to
> the current directory that does contain a file of that name, the file in
the
> current directory is removed before the mv command realizes that there was
> no file by that name in the other location.

Jason,
I could not reproduce what you described:

~ # date > fuu
~ # rm -f /tmp/fuu
~ # mv $_ .
mv: unable to rename `/tmp/fuu': No such file or directory
~ # ls -l fuu
-rw-r--r--    1 root     root           29 Jul 27 17:30 fuu
~ #

-- 
Felipe Kellermann


------------------------------



More information about the busybox mailing list