delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/20/13:47:35

Date: Wed, 20 Nov 2002 19:01:06 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <2110-Wed20Nov2002190106+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <ln7ntu0vk669lhkk2f3erqbejl9nejvnru@4ax.com> (message from
Wilfried Hennings on Wed, 20 Nov 2002 16:02:14 +0100)
Subject: Re: winXP, gcc: calling a batch file via system()
References: <ln7ntu0vk669lhkk2f3erqbejl9nejvnru AT 4ax DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: Wilfried Hennings <nospam AT fz-juelich DOT de>
> Newsgroups: comp.os.msdos.djgpp
> Date: Wed, 20 Nov 2002 16:02:14 +0100
> 
> Yes, I've got the most recent djgpp 2.03 distribution: downloaded
> yesterday from simtel, and did a fresh install.

I hope this is the refreshed v2.03, the one that has several fixes
that specifically target W2K and XP systems.  If not, please install
the refresh.

> - WinXP has TWO command processors, the old DOS/Win95/98 compatible
> "command.com" and the new NT4/Win2000/WinXP version "cmd.exe".
> The console window first starts with cmd.exe but when system() issues
> the "latex2png" command, a new process is started, by default with
> command.com, and the batch file is processed by command.com.

I believe this is the standard behavior of all Windows systems of the
NT family: they start command.com to run DOS programs.  Say "Thank
you, uncle Bill!"

> - When "system" searches for the existence of latex2png, it abbreviates
> the name to "latex2pn".

That's not true, to the best of my memory: the program name is not
abbreviated when `system' looks for it along the PATH.

DJGPP's library sources are freely available, so I suggest to download
djlsr203.zip and trace the execution of the functions on system.c and
dosexec.c modules.  If you see the abbreviation, please point out
where is it done.  Having the library sources will also help you
debug any additional problems you might have.

> - Main problem: When the batch file is called standalone, everything
> works as it should. When it is called from the C program via system() I
> get the message "Not enough environment space". I could not find out how
> to increase this space: anything I do only increases the space for the
> console window mother process but not for the daughter process. 

Invoke the batch file like this:

       command.com /e:2000 /c latex2png

(The above assumes that 2000 bytes of environment space is enough for
whatever latex2png.bat does.  If not, enlarge the number.)

- Raw text -


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