On Feb  3, 2001, Akim Demaille <[EMAIL PROTECTED]> wrote:

> The question is `is $FILE an executable in the common sense'.

I think the best thing to do is to just ignore the issue of whether
the found executable is a directory while testing -x or -f, and test
for -d later on, notifying the user and possibly aborting.  This
second test might have false positives on Cygwin if x/ and x.exe
exist, but I really don't care.  I'd rather warn the user that
something bad is about to happen.

As a data point to support this choice, directories aren't generally
skipped when searching the PATH.  So why should we?

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Reply via email to