stat vs open w/ ".exe"

Christopher Faylor
Fri Jul 5 10:03:00 GMT 2002

On Fri, Jul 05, 2002 at 02:28:09PM +0100, Conrad Scott wrote:
>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
>(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
> vs that in
>Is this a bug or a deliberate decision? and if the latter, why so?

It was a deliberate design decision.  It *has* been discussed many
times both in this group and in cygwin@cygwin.  I am not up to
trying to recreate the argument (it wasn't mine) today.  Maybe
someone else will.


More information about the Cygwin-developers mailing list