www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/04/01/19:29:02

Date: Thu, 1 Apr 93 16:48:34 CST
From: Shawn_McHorse AT fcircus DOT sat DOT tx DOT us (Shawn McHorse)
Subject: popen, pclose, and perror
To: djgpp AT sun DOT soe DOT clarkson DOT edu

	Howdy all!  I was just wondering if you could lend me a hand.  I
have been attempting to compile some C code I had lying around my hard
drive with DJGPP, which I just finished installing (GREAT program!). 
Anyway, some of the code uses the functions popen and pclose.  Under
UNIX, these functions work similarly to fopen and fclose except that
they open and close pipes rather than files.  I know that popen and
pclose are not generally considered portable to MS-DOS, but I found
prototypes for both functions in <stdio.h>.  However, when I went to
link the program the linker couldn't seem to find any reference to them
in the standard libraries.  For that matter, neither could I when I
grepped through all the .a files.  My question is, are popen and pclose
a part of the DJGPP standard libraries or not?  If not, does anyone know
of a good workaround to simulate popen and pclose?
	I also had a similar problem with the perror functions, which is
listed in <std.h>.  I don't know very much about perror, other than it
is generally used to print out an error message before exiting the
program.  I'm assuming perror is here somewhere, since it is a part of
<std.h>.  Do I just need to include a linker option, similar to the
"-lm" option for using the <math.h> library?
	Third and final question...:-)  I have another program which
uses the following constants:
     _MAX_PATH
     _MAX_DRIVE
     _MAX_DIR
     _MAX_FNAME
     _MAX_EXT
I looked through every C reference I have, and could find nothing about
these things.  I believe that they are MS-DOS specific, but I have not
seen them before.  Does anyone have a clue as to what these things
represent?  Thanks for your patience in reading all the way down
here...:-)  I'll chat with ya'll later.


P.S.  It would be REAL NICE to have the DJGPP documentation distributed
in PostScript form in a separate archive.  I just finished installing
GhostScript and all its many fonts (my God!).  Neither myself nor my
hard drive are looking forward to installing both EmTeX and DVIPS (and
all their fonts!!!) just so I can read program documentation in a
suitable form.  Thanks again...


-- 
Shawn_McHorse AT fcircus DOT sat DOT tx DOT us

Only YOU can prevent .sig abuse

- Raw text -


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