delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/10/28/23:23:50

Date: Thu, 28 Oct 93 19:47:38 PDT
From: Peter Crowley <pcrowley AT qdeck DOT com>
To: turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp, vic AT THEORY DOT qdeck DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: popen

Text item: 

>    If you don't really need pipes, but just want to pass input to a
>child process which is a filter, this can be done by using temporary
>files.  See the MS-DOS implementation of gawk (you can get it at any
>GNU mirror, eg wuarchive.wustl.edu).  It doesn't work quite right "out
>of the box" (it was intended for I think Turbo and MSC) but the mods
>needed for djgpp are obvious and take about fifteen minutes (look for
>"#ifdef MSDOS").

Attached is a popen() implementation which can be used by those who
- as mentioned above - do not need real pipes.

Peter Crowley
Quarterdeck Offices Systems
pcrowley AT qdeck DOT com

The following is an attached File item from cc:Mail.  It contains
eight bit information which had to be encoded to insure successful trans-
mission through various mail systems.  To decode the file use the UUDECODE
program.
--------------------------------- Cut Here ---------------------------------
begin 644 PIPE.C
M+RH@<&]P96XO<&-L;W-E('-U<'!O<G0 AT 9F]R($U31$]3("HO#0HO*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H-"B`@0V]P>7)I9VAT(#$Y.3,@475A<G1E
M<F1E8VL AT 3V9F:6-E(%-Y<W1E;7,-"B`@06QL(%)I9VAT<R!297-E<G9E9`T*
M#0H@(%!E<FUI<W-I;VX@=&\@9G)E96QY('5S92P AT 8V]P>2P@;6]D:69Y+"!A
M;F0 AT 9&ES=')I8G5T92!T:&ES#0H@('-O9G1W87)E(&9O<B!A;GD@<'5R<&]S
M92!I<R!H97)E8GD AT 9W)A;G1E9"P@<')O=FED960@=&AA="!T:&4-"B`@86)O
M=F4 AT 8V]P>7)I9VAT(&YO=&EC92!A<'!E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H)"61U<#(H<V%V95]S=&1I;BP@,"D[#0H)"6-L;W-E*'-A=F5?<W1D:6XI
M.PT*"7T AT 96QS92![#0H)"69C;&]S92AF*3L-"@E]#0H-"@EI9BAP:7!E<UMF
M9%TN;F%M92D@>PT*"0ER96UO=F4H<&EP97-;9F1=+FYA;64I.PT*"0EF<F5E
;*'!I<&5S6V9D72YN86UE*3L-"@E]#0I]#0H:
`
end




- Raw text -


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