next up previous contents
Next: ReadLine Up: Input and Output Functions Previous: readpipe

OpenPipe

Calling Sequence:
OpenPipe(
cmd)
Parameters:
cmd : a system command

Synopsis: The OpenPipe procedure passes the parameter cmd to the underlying operating system for execution. It attempts to establish a pipe between Darwin and the file specified in cmd. Afterwards, the pipe can be accessed via the ReadLine command.

This function should only be used from within a procedure.

Examples:

> GetFile := proc()
>   OpenPipe('zcat filename');   # uncompress 'filename' and
>                                     #  establish pipe.
>   for i from 1 to 10 do
>     t := ReadLine();                # read the 1st 10 lines.
>   od;
> end;

See also: readpipe, ReadLine, ReadOffsetLine




Gaston Gonnet
1998-09-15