From: "Tim Van Holder" To: , "Mark E." Cc: "Eli Zaretskii" Subject: Re: spawn* and LFN again Date: Fri, 11 May 2001 18:26:57 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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 Precedence: bulk > > > 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 .exe (and .bat, ...) only if a) does not exist and b) 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 , I expect it to run if it exists, and try .exe if it doesn't, instead of running .exe just because it exists.