public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* copying "file.exe" + "file" (a shell script) => targetdir fails
@ 2017-05-13  6:47 L A Walsh
  2017-05-13 14:30 ` cyg Simple
  0 siblings, 1 reply; 2+ messages in thread
From: L A Walsh @ 2017-05-13  6:47 UTC (permalink / raw)
  To: cygwin

I know *why* this is happening (cygwin treating x.exe as x), but
should it do it for shell files too?

sourcedir:
>  ll -di bin/updatedb bin/updatedb.exe
337488497076088359 -rwxrwxr-x+ 1  10163 Apr 12 17:07 bin/updatedb*
144115188075956844 -rwxrwxr-x+ 2 287813 Apr 15  2014 bin/updatedb.exe*
(two different files, different types:)
>  file bin/updatedb{,.exe}
bin/updatedb:     Bourne-Again shell script, ASCII text executable
bin/updatedb.exe: PE32+ executable (console) x86-64, for MS Windows


>  cp -l bin/updatedb /nbin/
cp: cannot create hard link '/nbin/updatedb' to 'bin/updatedb': File exists

cp thinks /nbin/updatedb is the same as /nbin/updatedb.exe (and prevents
copying a real 'updatedb' script into the same place:

(target):
>  ll -i /nbin/updatedb.exe /nbin/updatedb
144115188075956844 -rwxrwxr-x+ 2 287813 Apr 15  2014 /nbin/updatedb*
144115188075956844 -rwxrwxr-x+ 2 287813 Apr 15  2014 /nbin/updatedb.exe*

But I can create a dir named /nbin/updatedb:

>  mkdir /nbin/updatedb

And now have 2 different inodes in target:

>  ll -di bin/updatedb bin/updatedb.exe
337488497076088359 -rwxrwxr-x+ 1  10163 Apr 12 17:07 bin/updatedb*
144115188075956844 -rwxrwxr-x+ 2 287813 Apr 15  2014 bin/updatedb.exe*

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

Is this suppose to work this way?

(I know how to work around this (used move in cmd.exe),
but why can I create a dir but not a file there?

A bit strange -- guess it isn't often I have both a "file"
and "file.exe" in a dir.

-linda







--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: copying "file.exe" + "file" (a shell script) => targetdir fails
  2017-05-13  6:47 copying "file.exe" + "file" (a shell script) => targetdir fails L A Walsh
@ 2017-05-13 14:30 ` cyg Simple
  0 siblings, 0 replies; 2+ messages in thread
From: cyg Simple @ 2017-05-13 14:30 UTC (permalink / raw)
  To: cygwin

On 5/13/2017 1:22 AM, L A Walsh wrote:
> I know *why* this is happening (cygwin treating x.exe as x), but
> should it do it for shell files too?
> 
> sourcedir:
>>  ll -di bin/updatedb bin/updatedb.exe
> 337488497076088359 -rwxrwxr-x+ 1  10163 Apr 12 17:07 bin/updatedb*
> 144115188075956844 -rwxrwxr-x+ 2 287813 Apr 15  2014 bin/updatedb.exe*
> (two different files, different types:)
>>  file bin/updatedb{,.exe}
> bin/updatedb:     Bourne-Again shell script, ASCII text executable
> bin/updatedb.exe: PE32+ executable (console) x86-64, for MS Windows
> 
> 
>>  cp -l bin/updatedb /nbin/
> cp: cannot create hard link '/nbin/updatedb' to 'bin/updatedb': File exists
> 
> cp thinks /nbin/updatedb is the same as /nbin/updatedb.exe (and prevents
> copying a real 'updatedb' script into the same place:
> 
> (target):
>>  ll -i /nbin/updatedb.exe /nbin/updatedb
> 144115188075956844 -rwxrwxr-x+ 2 287813 Apr 15  2014 /nbin/updatedb*
> 144115188075956844 -rwxrwxr-x+ 2 287813 Apr 15  2014 /nbin/updatedb.exe*
> 
> But I can create a dir named /nbin/updatedb:
> 
>>  mkdir /nbin/updatedb
> 
> And now have 2 different inodes in target:
> 
>>  ll -di bin/updatedb bin/updatedb.exe
> 337488497076088359 -rwxrwxr-x+ 1  10163 Apr 12 17:07 bin/updatedb*
> 144115188075956844 -rwxrwxr-x+ 2 287813 Apr 15  2014 bin/updatedb.exe*
> 
> ------------
> 
> Is this suppose to work this way?
> 

As far as I remember it always has.

> (I know how to work around this (used move in cmd.exe),

Well, there is a different method to work around this:
cp -l bin/updatedb. /nbin/

Note the period after the filename; this stops the pseudo symlink from
using updatedb.exe because bin/updatedb..exe doesn't exist.

> but why can I create a dir but not a file there?
> 

You weren't creating a file there, you were copying a file the file
source is getting confused and not the destination.

> A bit strange -- guess it isn't often I have both a "file"
> and "file.exe" in a dir.
> 

You probably can find something about this via google.  Yours isn't the
first report.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-13 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-13  6:47 copying "file.exe" + "file" (a shell script) => targetdir fails L A Walsh
2017-05-13 14:30 ` cyg Simple

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).