Mail Archives: djgpp-workers/1999/03/26/03:58:36
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Just as an idea: in traditional DOS (i.e. command.com), program.bat is the
*last* thing that will be tried when you call 'program'. The command.com
search order is
doskey macro (if any)
in '.', and then in each directory of the PATH:
{
program.com
program.exe
program.bat
}
We do the same, we just append `program' at the end of this list.
So, if 'program' is a COFF binary, i.e. more like an .exe than a .bat,
then it should be tried before program.bat, IMHO. If it's a Bourne sh
script, I'ld still prefer trying it before the crippled .bat script.
You cannot do that on LFN systems, because `program' might be actually
something like `foo.bar.bat', and to further complicate matters, there
might be a program in the same directory called `foo.bar.bat.exe'. I
know this is a bit perverse, but a user is entitled to have that.
Moreover, there could be a directory `foo' and a program `foo.exe', in
which case again it is better to try `foo.exe' first.
And if that is not enough, running a raw COFF executable requires
go32-v2 to be present, so if it is not available, you will fail;
trying the .exe first works better in this case as well.
So, on balance, I think trying with the extension first is a better way.
- Raw text -