www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/14/05:55:03

From: christian DOT gasser AT elca DOT ch (Christian Gasser)
Newsgroups: comp.os.msdos.djgpp
Subject: problem with system library call
Date: Fri, 14 Feb 1997 06:53:16 GMT
Organization: ELCA Informatique S.A.
Lines: 65
Message-ID: <5e1252$2k2@news.eunet.ch>
NNTP-Posting-Host: hle087.elca.ch
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi !

Context: I am trying to get a program called "webify" to run on DJGPP
and Win95.
Webify is a simple program that converts a PostScript file into a set
of HTML pages and JPEG files. It does this mostly by running
GhostScript and Cjpeg through a series of calls to the "system"
library function.

Problem: after four or five almost identical calls to "system", I
start to get weird results. It goes like this:

1) 'system("GS ...blahblah...")' - runs fine
2) 'system("hackppm < T001.ppm | cjpeg -outfile T001.jpg")' - ok
3) 'system("hackppm < T002.ppm | cjpeg -outfile T002.jpg")' - also ok
4) 'system("hackppm < T003.ppm | cjpeg -outfile T003.jpg")' - still ok
5) 'system("hackppm < T004.ppm | cjpeg -outfile T004.jpg")' - fails
because of "empty input file" or "file creation error" or even "not a
GIF file".

I've also tried variations of this, e.g. breaking up the calls into
smaller ones, using temp files, ...

If "system" is called a few times before (e.g. with command strings
like "cjpeg -help > /dev/null "), the failure appears sooner, so I'm
beginning to suspect that "system" has some dark side-effects or leaks
resources.

Any help or suggestions will be most welcome.
TIA
	Chris

As instructed by the FAQ here is the output of the SET and GO32
commands:

*** ENVRION.LST
winbootdir=C:\WINDOWS
COMSPEC=C:\COMMAND.COM
PROMPT=$P$G
TEMP=C:\TEMP
TMP=C:\TEMP
TZ=CET-1CST
SOUND=C:\DEVICE\SBPRO
HOME=C:\
HOMEDRIVE=C:
HOMEPATH=\
windir=C:\WINDOWS
BLASTER=A220 I5 D1
DJGPP=G:\DJGPP\DJGPP.ENV
PATH=.;G:\DJGPP\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\DOS
CMDLINE=webify -d -N -F -r 1 -t "W" webify~1.tem webify~1.ps

***GO32.LST
go32/v2 version 2.0 built Jan 23 1996 22:03:02
Usage: go32 coff-image [args]
Rename this to go32.exe only if you need a go32 that can run v2
binaries as well as v1 binaries (old makefiles).  Put ahead of the old
go32 in your PATH.
DPMI memory available: 9908 Kb
DPMI swap space available: 3464 Kb



----- christian DOT gasser AT elca DOT ch -----

- Raw text -


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