delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/05/11/12:32:19

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: <djgpp-workers AT delorie DOT com>, "Mark E." <snowball3 AT bigfoot DOT com>
Cc: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Subject: Re: spawn* and LFN again
Date: Fri, 11 May 2001 18:26:57 +0200
Message-ID: <CAEGKOHJKAAFPKOCLHDIIEDICDAA.tim.van.holder@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <1190-Fri11May2001132345+0300-eliz@is.elta.co.il>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > > What happens with lfnexe.bat.exe or lfnexe.foo.exe?
> > 
> > gcc -o lfnexe.bat.exe lfnexe2.c
> > 
> > >lfnexe.bat
> > Bad command or file name
I think you would get the same for lfnexe.exe if only lfnexe.exe.exe
exists.

> 
> Then I think spawn*'s logic is better.  It doesn't make sense, IMHO,
> to find a program lfnexe.foo.exe, but fail to find lfnexe.foo.  If I
> replace the first dot with something else, as in lfnexe_foo, then both
> lfnexe_foo and lfnexe_foo.exe work.  That is, COMMAND.COM (at least on
lfnexe.foo.exe would actually work; (for example, for hello.world.exe,
both 'hello.world' and 'hello.world.exe' run the executable).
Only if foo is exe/com/bat does command.com stop looking.

> Windows 98) treats the dot specially here, probably because someone
> left the old DOS logic intact.
> 
> However, if there are specific problems with what spawn* does, please
> tell what they are.
> 
Hmm - I think command.com's logic makes a lot of sense though.
From what has been posted it will look for <foo>.exe (and <foo>.bat, ...)
only if a) <foo> does not exist and b) <foo> does not already end in an
executable extension.

spawn seems to always tack on .exe/..., even if the extension is already
'executable'.  I don't think it makes sense to try, say, foo.sh.exe before
trying foo.sh; the same should go for lfn.exe - you should only try
lfn.exe.exe if you're asked for it directly.

Basically, if I ask spawn to run <foo>, I expect it to run <foo> if it
exists, and try <foo>.exe if it doesn't, instead of running <foo>.exe
just because it exists.

- Raw text -


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