delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2002/07/05/09:26:17

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Message-ID: <03e001c22427$ce581a00$6132bc3e@BABEL>
From: "Conrad Scott" <Conrad DOT Scott AT dsl DOT pipex DOT com>
To: <cygwin-developers AT cygwin DOT com>
Subject: stat vs open w/ ".exe"
Date: Fri, 5 Jul 2002 14:28:09 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

I think this has been discussed before but I've searched the
mailing lists to no avail, so here goes.

If you *stat* a file with no suffix, e.g. /bin/bash, it will
succeed if there is a file /bin/bash.exe.

If you *open* a file with no suffix, it doesn't succeed in that
case.

(So "ls /bin/bash" succeeds and "strings /bin/bash" fails.)

In other words, stat(2) also checks for the file with a .exe
extension, while open(2) doesn't.  The difference comes down to
the call to cygheap->fdtab.build_fhandler_from_name() in
syscalls.cc:_open() vs that in syscalls.cc:stat_worker().

Is this a bug or a deliberate decision? and if the latter, why so?

// Conrad



- Raw text -


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