This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATHEXT is fundamental to Windows and Should be recognised by CYGWIN


On Aug  8 09:52, Erik Soderquist wrote:
> On Sun, Aug 7, 2016 at 4:11 AM, Herbert Stocker wrote:
> >>
> >> code required to handle .exe and .lnk extensions you don't *want*
> >> PATHEXT support anymore.
> >>
> >
> > Moreso, this code has recently broken my C++ code in Cygwin.
> > It tried to see if a directory  /dir/subdir/something  existed,
> > and Cygwin said yes because it found a /dir/subdir/something.exe .
> > So my program failed.
> 
> Were you testing for the existence of a *directory* (
> /dir/subdir/something/. ) or for anything named *something* in
> /dir/subdir/ ?
> 
> And what call were you using?  It was my understanding that the foo ==
> foo.exe == foo.lnk == foo.exe.lnk was only applied when attempting to
> execute something...  (is my understanding wrong?)

Yes.  It's also applied when stat'ing si or access'ing something.  The
same rules apply.  Consider:

  if (access ("foo", X_OK) == 0)
    execve ("foo", ...);
  else
    error ("foo not executable");

Consider that every call of the application has some reason Cygwin
just can NOT double guess.  If you skip the .exe/.lnk tests, you're\
basically doomed in one scenario or the other.

Been there, done that, no joy.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]