Next: , Previous: bpipe_iochannel_new, Up: Internal Functions   [Contents]


A.5.18 bpipe_iochannel_open

open an I/O channel

Synopsis

#include <bpipe/bpipe.h>

int bpipe_iochannel_open(
  IOchannel *ioc,
  const char *mode
);

Parameters

IOchannel *ioc

a pointer to the IOchannel to open

const char *mode

the mode with which to open the channel, see fopen for details

Description

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.

Returns

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.