Next: bpipe_iochannel_read, Previous: bpipe_iochannel_new, Up: Internal Functions
open an I/O channel
#include <bpipe/bpipe.h>int bpipe_iochannel_open( IOchannel *ioc, char *mode );
IOchannel *ioc
- a pointer to the
IOchannel
to openchar *mode
- the mode with which to open the channel, see
fopen
for details
This routine opens a previous allocated I/O channel.
It recognizes the paths ‘stdin’ and ‘stdout’ as special,
and connects the channel to stdin
or stdout
respectively. In these cases, mode is ignored.
It returns zero upon succes, non-zero if it cannot open the path.
errno
should be checked upon error (not bpipe_errno
), as
it is set by fopen
.