[BusyBox] mv is deleting files!

Steven Scholz steven.scholz at imc-berlin.de
Thu Jul 14 08:10:16 UTC 2005


Hi there,

I just noticed something strange with busybux-1.00 mv command:

~ # ls -l /opt/imc/idxcan
ls: /opt/imc/idxcan: No such file or directory

	[Ok. cause the file is not there yet.]

~ # ls -l /tmp/idxcan
-rw-r--r--    1 root     root      1154716 Jan  1 00:43 /tmp/idxcan

	[This file will be moved to /opt/imc]

~ # mv /tmp/idxcan /opt/imc/
~ # ls -l /tmp/idxcan
ls: /tmp/idxcan: No such file or directory
~ # ls -l /opt/imc/idxcan
-rw-r--r--    1 root     root      1154716 Jan  1 00:43 /opt/imc/idxcan

	[OK. File was moved from /tmp to /opt/imc]

~ # mv /tmp/idxcan /opt/imc/
mv: /tmp/idxcan: No such file or directory

	[Fair enough. Cause the file was moved.]

~ # ls -l /opt/imc/idxcan
ls: /opt/imc/idxcan: No such file or directory

	[Oops!!! The mv that failed apparently deleted the target!]

Is that a bug or a feature.
Unfotunatly I can't test any new busybox version. But maybe someone else 
might want to try that.

(BTW: /tmp is tmpfs, /opt/imc is jffs2)

--
Steven




More information about the busybox mailing list