popen()

D'Arcy J.M. Cain darcy at druid.uucp
Mon Mar 5 00:25:31 AEST 1990


In article <1503 at loria.crin.fr> anigbogu at loria.crin.fr (Julian Anigbogu) writes:
>Can some kind soul point me to where I can get a PC implementation of
>the Unix C popen() /* for handle to a pipe */. I manipulate huge
>rasterfiles(from a scanner) on a Sun and I adopted the policy of
>compressing all files to save disk space. I open them with
>popen("uncompress -c filename","r") so that they remain compressed on
>disk. 
>
> I now need to port the programs to DOS and to my chagrin my regular
>compiler doesn't implement a pipe open.
>
With good reason.  DOS is a single tasking system so you can't have a
program running without putting the current one on hold first.  The best
way to do what you want is to have the uncompression itself as a subroutine
that returns a specified number of bytes and just call it instead of a
read function.  This is the way I did it and it works just fine.  My function
returns one byte at a time although you could easily make the number of
bytes to return a parameter.

This is not really a C question so followups directed to
comp.sys.ibm.pc.programmer

-- 
D'Arcy J.M. Cain (darcy at druid)     |   Thank goodness we don't get all 
D'Arcy Cain Consulting             |   the government we pay for.
West Hill, Ontario, Canada         |
(416) 281-6094                     |



More information about the Comp.lang.c mailing list