WRITEPIPEDATA(3A) WRITEPIPEDATA(3A)
NAME
WritePipeData, WritePipeDataV - asynchronously write a block
of data to a pipe
SYNOPSIS
WritePipeData (ready, error, arg, buf, size, cmd, arg ...)
int (*ready)();
char *(*error)();
int arg;
char *buf;
int size;
char *cmd;
char *arg;
WritePipeDataV (ready, error, arg, size, cmd, argv)
int (*ready)();
char *(*error)();
int arg;
int size;
char *cmd;
char *argv;
DESCRIPTION
WritePipeData and WritePipeDataV write binary data to a
pipe. A command is executed with its standard input file
redirected to a pipe. The full path name of the command to
execute is in cmd. For WritePipeData , arguments for the
command (starting with arg as argument zero) follow the
command in a NULL terminated parameter list. For
WritePipeDataV , the arguments are in the NULL-terminated
array of strings argv. The buffer of data to write is in
buf and the number of bytes to write is in size. The
function ready is called when the data has been written, and
the function error is called upon an error. Either function
may be NULL, in which case it will not be called. When
there is an error, the pipe is closed, so exactly one of the
two functions ready and error is called. The argument arg
is passed to both routines.
Page 1 (printed 9/3/91)
WRITEPIPEDATA(3A) WRITEPIPEDATA(3A)
The calling sequence for ready is as follows:
ready (arg, status)
int arg;
int status;
The first argument arg is the argument supplied to
WritePipeData or WritePipeDataV. The child's exit status is
in status.
The calling sequence for error is as follows:
error (arg, errno)
int arg;
int errno;
The user-supplied data to WritePipeData or WritePipeDataV is
passed in arg and an error code interpreted the same as the
system global variable errno is passed in errno .
WritePipeData and WritePipeDataV return the process ID of
the child process on success, or -1 upon error.
NOTES
There are lower-level asynchronous I/O routines AddIoProc,
RemoveIoProc, OpenWritePipe, and ClosePipe that provide
greater flexibility at the expense of greater coding effort.
WritePipeData and WritePipeDataV use these routines to set
up an asynchronous write procedure.
SEE ALSO
XtAppAddInput(3Xt), XtRemoveInput(3Xt), AddIoProc(3A),
RemoveIoProc(3A), OpenWritePipe(3A), ClosePipe(3A),
ReadFileData(3A), ReadFileLines(3A), ReadFileStrings(3A),
ReadPipeData(3A), ReadPipeLines(3A), ReadPipeStrings(3A),
WriteFileData(3A), WriteFileLines(3A), WritePipeLines(3A)
Page 2 (printed 9/3/91)