popen man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

popen(3S)							     popen(3S)

NAME
       popen(), pclose() - initiate pipe I/O to/from a process

SYNOPSIS
DESCRIPTION
       creates a pipe between the calling program and a command to be executed
       by the POSIX shell, (see sh-posix(1)).

       The arguments to are pointers to	 null-terminated  strings  containing,
       respectively,  a shell command line and an I/O mode, either for reading
       or for writing.

       returns a stream pointer such that one can write to the standard	 input
       of  the	command	 if the I/O mode is by writing to the file stream; and
       one can read from the standard output of the command if the I/O mode is
       by reading from the file stream.

       Because	open  files are shared, a type command can be used as an input
       filter and a type command as an output filter.  If mode is  other  than
       or the result is undefined.

       A  stream  opened by should be closed by which waits for the associated
       process to terminate and returns the exit status of the command.	  How‐
       ever, if a call caused the termination status to be unavailable to then
       returns -1 with errno set to This can happen in one  of	the  following
       conditions:

       ·  If the signal handler for is set to

       ·  If  the  signal handler or another thread in the same process issues
	  or call.

APPLICATION USAGE
       After a stream is associated with a pipe by the stream is byte-oriented
       (see orientation(5)).

RETURN VALUE
       Upon  successful	 completion,  returns a pointer to an open stream that
       can be used to read or write to the pipe.  Otherwise, it returns a NULL
       pointer	if files or processes cannot be created and set errno to indi‐
       cate the error.	The success of the command execution can be checked by
       examining the return value of

       Upon  successful	 return, returns the termination status of the command
       language interpreter.  Otherwise, returns -1 if stream is  not  associ‐
       ated with a command and set errno to indicate the error.

ERRORS
       The function fails if:

       The maximum number of file descriptors allowed are currently open.

       The function fails if:

       The status of the child process is not available.

WARNINGS
       If the original and processes concurrently read or write a common file,
       neither should use buffered I/O because the  buffering  will  not  work
       properly.  Problems with an output filter can be forestalled by careful
       buffer flushing, e.g., with see fclose(3S).

SEE ALSO
       pipe(2), wait(2), fclose(3S),  fopen(3S),  system(3S),  orientation(5),
       thread_safety(5).

STANDARDS CONFORMANCE
								     popen(3S)
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net