[BusyBox 0001470]: cp says "cannot remove..." when trying to copy a file to a non-existent directory

bugs at busybox.net bugs at busybox.net
Fri Aug 24 08:58:07 PDT 2007


The following issue has been REOPENED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1470 
====================================================================== 
Reported By:                kiltedknight
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1470
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             08-23-2007 10:55 PDT
Last Modified:              08-24-2007 08:58 PDT
====================================================================== 
Summary:                    cp says "cannot remove..." when trying to copy a
file to a non-existent directory
Description: 
Run this sequence of commands:

touch /tmp/foo
busybox cp /tmp/foo /tmp/nonexistent/path/foo

This is the error message you get:
cp: cannot remove '/tmp/nonexistent/path/foo': No such file or directory

What Linux's cp will say is:
cp: cannot create regular file `/tmp/nonexistent/path/foo': No such file
or directory

If you have DO_POSIX_CP enabled, you will get:
'/tmp/nonexistent/path/foo' exists

Unless you specify the -f or -i flag, in which case you get the "cannot
remove" message
====================================================================== 

---------------------------------------------------------------------- 
 vda - 08-24-07 07:22  
---------------------------------------------------------------------- 
> This is the error message you get:
> cp: cannot remove '/tmp/nonexistent/path/foo': No such file or
directory

Which is true. cp couldn't create it. cp decided to try unlink,
and creating again. unlink didn't work either. cp lets you know that.

> What Linux's cp will say is:
> cp: cannot create regular file `/tmp/nonexistent/path/foo': No such file
or directory

Read it again.

Do you really think that "I can't create 'foo', it doesn't exist" is
better?


More information about the busybox-cvs mailing list