public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: cyg Simple <cygsimple@gmail.com>
To: cygwin@cygwin.com
Subject: Re: copying "file.exe" + "file" (a shell script) => targetdir fails
Date: Sat, 13 May 2017 14:30:00 -0000	[thread overview]
Message-ID: <3618b40c-9796-d6f8-8802-fdd69116dc25@gmail.com> (raw)
In-Reply-To: <59169826.3060609@tlinx.org>

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

      reply	other threads:[~2017-05-13 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13  6:47 L A Walsh
2017-05-13 14:30 ` cyg Simple [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3618b40c-9796-d6f8-8802-fdd69116dc25@gmail.com \
    --to=cygsimple@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).