delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/23/15:00:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: ericblake AT comcast DOT net (Eric Blake)
To: cygwin AT cygwin DOT com
Subject: Re: Coreutils (mv) bug
Date: Thu, 23 Jun 2005 19:00:31 +0000
Message-Id: <062320051900.17633.42BB06CF0007C754000044E122007610640A050E040D0C079D0A@comcast.net>
X-Authenticated-Sender: ZXJpY2JsYWtlQGNvbWNhc3QubmV0

> On Thu, Jun 23, 2005 at 06:11:42PM +0000, Eric Blake wrote:
> >It would be really nice if there were a new flag to access() that supressed
> >.exe expansion, and succeeded only if the exact spelling matched.  Then
> >my test to see if .exe should be appended would be as simple as
> >access("foo", F_OK) == 0 && access("foo", F_OK | __NO_EXE_MAGIC) == -1.
> >Furthermore, access() seems like it may be more efficient than open() in
> >terms of the underlying work that must be done to implement it.
> 
> Just append a dot to the end of the filename.

That currently doesn't work on managed mounts, where .exe magic still
happens but trailing dots no longer get stripped.  Whatever trick coreutils
uses to undo .exe magic must work in all cases, so it would really be nice
if there were a blessed cygwin syscall that made supressing .exe magic
easy.  (Note that undo'ing .exe magic is not done all that often, and that
only a few coreutils must worry about it so that everyone else gets the
benefit).

For that matter, should managed mounts even be doing .exe magic?
$ cd managed
$ ls sh*
ls: sh*: No such file or directory
$ cp /bin/sh.exe sh.exe
$ ./sh          # Current behavior:
# New /bin/sh shell is spawned
$ ./sh         # Desired behavior:
bash: ./sh: No such file or directory

--
Eric Blake



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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019