delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/02/01/06:30:11

From: "Peter S Tillier" <petert AT deadspam DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gawk 3.1.1 DJGPP v2.04 on Windows 2000 Pro problem using system() function and LFNs
Date: Sat, 1 Feb 2003 10:32:35 -0000
Organization: Private
Lines: 82
Message-ID: <b1g7o5$jf5$1$8300dec7@news.demon.co.uk>
References: <3e360683 DOT sandmann AT clio DOT rice DOT edu> <b16lck$d1e$1$8300dec7 AT news DOT demon DOT co DOT uk> <3e37507d DOT sandmann AT clio DOT rice DOT edu> <v3flgkt0bfj19 AT corp DOT supernews DOT com> <3e3a018b DOT sandmann AT clio DOT rice DOT edu>
NNTP-Posting-Host: eq1152.demon.co.uk
X-Trace: news.demon.co.uk 1044095558 19941 158.152.22.92 (1 Feb 2003 10:32:38 GMT)
X-Complaints-To: abuse AT demon DOT net
NNTP-Posting-Date: Sat, 1 Feb 2003 10:32:38 +0000 (UTC)
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

[Replying to both Charles and Eli - with thanks to both]

"Charles Sandmann" <sandmann AT clio DOT rice DOT edu> wrote in message
news:3e3a018b DOT sandmann AT clio DOT rice DOT edu...

> > I did try this but as Eli says in his posting, I don't
> > think that SHELL= should take parameters such as /C.
>
> It's just what you need to pass to cmd.exe to get it to
> execute the command after /C, then exit.
>

Yes I did know that, but the syntax of the SHELL= line
(in config.sys, at least) indicates that the only
parameters that it should receive are those such as
/p or /e.

> > i.e., despite ver and echo %COMSPEC% saying that
> > we're using cmd.exe, DJGPP gawk's ENVIRON array
> > thinks that we're using COMMAND.COM
>
> Each DJGPP image is launched in a virtual DOS machine
> (see ntvdm.exe in your task list) which has a
> command.com loaded.  So in a sense, you are under
> command.com in that environment.  But CMD.EXE knows
> how to launch programs in the VDM and pass parameters
> to them.
>

This is the point that I had missed - I think I have
come across it before many years ago when I used to
use NT3.51, but I had forgotten it!

[...]
> Anything's possible - I try things on my Win98
> environment and Win2K and see if they act the same.
> The source is always available :-)
>

In the case that started this thread the problem was
that I assumed (wrongly as you and Eli have pointed out)
that if an environment specified a value for COMPSEC
then that would be used by any system() calls made by
gawk.  I understand why MS have done this, but it is
certainly counter intuitive.

[...]
> Don't worry about the "command.com" thing - it's normal.
> Not handling spaces properly in passing - that might
> be a real problem...
>

There is a bug in COMMAND.COM for W2K according to the MS
TechNet in that it doesn't handle parameters correctly.  It
applies to W2K, SP1 and SP2, but is corrected in SP3.


"Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> wrote in message
news:Pine DOT SUN DOT 3 DOT 91 DOT 1030129162053 DOT 20453C-100000 AT is...
[...]
> This is not odd at all: all Windows versions of the NT family do
special
> tricks so that DOS programs have COMMAND.COM as their COMSPEC's value.
> Windows does that on purpose; there's almost nothing a DJGPP program
can
> do to work around this.
>

Thanks for pointing this out - as I say I think that I did
know about once, but had forgotten it!

[...]

I appreciate the time and effort that you have all given.

Regards,
Peter
--
Peter S Tillier
"Who needs perl when you can write dc and sokoban in sed?"


- Raw text -


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