'cp' utility bug when <dest-name>.exe file exist.
Eric Blake
eblake@redhat.com
Tue Jun 8 14:02:00 GMT 2010
On 06/08/2010 07:47 AM, Oleksandr Gavenko wrote:
> $ touch my.exe
> $ touch some-file
> $ cp some-file my
> cp: cannot create regular file `my': File exists
> $ cp -f some-file my
> cp: cannot create regular file `my': File exists
>
> Same happen ever in cmd.exe so this is not 'bash' fault.
This is an issue with the fact that cygwin has to support .exe magic.
The problem is that cygwin (rightly) refuses to create "my" if "my.exe"
exists. But which is better? Cygwin doesn't know whether you meant to
delete my.exe and replace it with "my", or if you meant to replace
"my.exe" but keep the magic suffix. Since we don't know the right
hueristics for patching rename(2) (and/or cp(1)) to guess what most
people want most of the time, I think that the error message is the best
we can do in this particular case of file name conflict.
But I'm welcome to the idea of changing coreutils to try and do a more
sensible action, if we can get list consensus on what a more sensible
action would be.
--
Eric Blake eblake@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100608/c8db4d48/attachment.sig>
More information about the Cygwin
mailing list