Next: , Previous: bpipe_new, Up: BPipe Manipulations


A.1.6 bpipe_output

create a binary pipe output channel

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
BPipeOutput *bpipe_output( BPipe *bpipe, char *path );

Parameters

BPipe *bpipe
a pointer to the binary pipe structure
char *path
the path to the channel to attach to this output descriptor

Description

bpipe_output attaches an output stream and opens it.

The parameter output is a string describing the output file or device associated with the output channel. If it is the string ‘stdout’, the output channel is associated with the standard output stream.

Returns

It returns an output handle upon success, NULL upon failure.

Errors

Upon error bpipe_errno is set to one of the following errors:

BPEBADARG
The passed path could not be opened. Check errno for more information.
BPEBADPIPE
The BPipe's header has already been mapped or written. Output channels can only be opened before mapping or writing the header
BPENOMEM
a memory allocation failed