This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 'cp' utility bug when <dest-name>.exe file exist.


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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]