home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma74.lha / MAShare74 / unsit1.5c.amiga / docs / pio.man < prev    next >
Text File  |  1991-09-08  |  1KB  |  47 lines

  1.  
  2.  
  3. POPEN                               AMIGA                                POPEN
  4.  
  5.  
  6.  
  7. NAME
  8.      popen, pclose - initiate I/O to/from a process
  9.  
  10. SYNOPSIS
  11.      #include <pio.h>
  12.  
  13.      FILE *popen(command, type)
  14.      char *command, *type;
  15.  
  16.      pclose(stream)
  17.      FILE *stream;
  18.  
  19. DESCRIPTION
  20.      The arguments to popen are pointers to null terminated strings containing
  21.      respectively a shell command line and an I/O mode, either "r" for reading
  22.      or "w" for writing.  It creates a pipe between the calling process and
  23.      the command to be executed.  The value returned is a stream pointer that
  24.      can be used (as appropriate) to write to the standard input of the
  25.      command or read from its standard output.
  26.  
  27.      A stream opened by popen should be closed by pclose, which waits for the
  28.      associated process to terminate and returns the exit status of the
  29.      command.
  30.  
  31.      Because open files are shared, a type "r" command can be used as an input
  32.      filter, and a type "w" as an output filter.
  33.  
  34. SEE ALSO
  35.      Execute() ["The AmigaDOS Manual"], "FIFO.DOC".
  36.  
  37. DIAGNOSTICS
  38.      popen returns a NULL pointer if files or processes cannot be created.
  39.  
  40.      pclose returns -1 if stream is not associated with a popened command.
  41.  
  42. BUGS
  43.      Suitable errno values & perror() messages are not available for the
  44.      various conditions that popen() may fail.
  45.  
  46.      No longer possible to identify a process pipe solely on it's TaskPtr.
  47.