sc68fordevelopers  2.2.1
Functions
istream68_fd.h File Reference

file descriptor stream operation. More...

#include "file68/istream68.h"

Go to the source code of this file.

Functions

istream_tistream_fd_create (const char *fname, int fd, int mode)
 Creates a stream for "UNIX" file descriptor. More...
 

Detailed Description

file descriptor stream operation.

Author
benjamin gerard
Date
2003/08/08
Id
istream68_fd.h,v 1.2 2003/09/30 06:29:57 benjihan Exp

isteam68_fd implements istream_t for file descriptor.

Function Documentation

istream_t* istream_fd_create ( const char *  fname,
int  fd,
int  mode 
)

Creates a stream for "UNIX" file descriptor.

If fd parameters is not -1, it is used to as file descriptor for the stream and fname is used for naming the stream. Else the file is open as a regular file with fname as path.

Parameters
fnamepath of file or 0.
fdfile decriptor or -1.
modebit-0: read access, bit-1: write access.
Returns
stream
Return values
0on error
Note
filename is internally copied.
Even if fd is given the istream_open() must be call.
Warning
When opening a stream with an already opened descriptor the mode should match the real open mode but since no tests are performed before calling r/w access, it should not failed in case of wrong access on given mode.