[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: bug regarding os.execute?
- From: Thomas Lauer <thomas.lauer@...>
- Date: Mon, 21 Jul 2008 13:52:10 +0100
"Robert Raschke" <email@example.com> wrote:
> On 7/21/08, Thomas Lauer <firstname.lastname@example.org> wrote:
> > Actually, this seems to be an artifact of CMD.EXE and not so much a rule
> > in Windows. (Rules in Windows? Wonder what that means anyway;-)
> > At least my command-line interpreter (the delectable JPSoft 4NT/Take
> > Command) as well as the Start menu Run... box execute both commands
> > above without problem. (Indeed, I'll take this opportunity to point
> > interested readers to the freeware version of the JPSoft CLI (called
> > TCC/LE) which beats CMD.EXE hands down in terms of features and
> > usability.)
> Well, it's actually system() that gets invoked by os.execute(). And
> system() in turn goes and finds CMD.EXE to execute your command line.
Nope. Here, system() -- which is MSVCRT.DLL's system() -- calls whatever
happens to be in environment variable COMSPEC. In my case that's 4NT.
It's all a big muddle but I think it's safe to say that this "bug" is a
CMD.EXE bug. It doesn't happen with my setup.
> And, yes, I hate Windows too. Took me two days to figure out the weird
> quoting, for example.
Well, I wouldn't say I hate it. It's more an complex, if sometimes
annoying, computer game;-)
I like to think that Windows gets much more consistent once you get the
hang of how certain things hang together. Having said that, there are
still far too many inconsistencies.
> I guess if you want to use some other command interpreter on Windows,
> you'll need to write a wrapper function for that using _exec() et al.
It all depends on the system() implementation in the C runtime. These
dependencies are what makes much of Lua's runtime calls such a