group
group__libshare__fsstream
Access share-fs file I/O using a streamed buffer.

File Buffered Stream

typedef
typedef struct shfstream_t shfstream_t
function
int shfstream_init
(shfstream_t *stream, SHFL *file)
[ ]
Initialize a file stream.
function
int shfstream_open
(shfstream_t *stream, const char *path, shfs_t *fs)
Open a file stream.
function
shfstream_t* shfstream_get
(int fd)
Obtain a file stream's descriptor data.
function
int shfstream_getfd
(void)
Get the next available file stream descriptor number.
function
int shfstream_setpos
(shfstream_t *stream, size_t pos)
Set the current byte position of a file stream.
function
size_t shfstream_getpos
(shfstream_t *stream)
Obtain the current byte position of a file stream.
function
int shfstream_close
(shfstream_t *stream)
Transition file stream into a closed state.
function
int shfstream_stat
(shfstream_t *stream, struct stat *buf)
function
int shfstream_truncate
(shfstream_t *stream, size_t len)
function
int shfstream_alloc
(shfstream_t *stream, size_t size)
function
int shfstream_flush
(shfstream_t *stream)
function
ssize_t shfstream_read
(shfstream_t *stream, void *ptr, size_t size)
function
ssize_t shfstream_write
(shfstream_t *stream, const void *ptr, size_t size)
function
int shfstream_sync
(shfstream_t *stream)
Flushes any unwritten data to the file-system.
Note
Flushes at a maximum rate of once per second.
define
SHFS_STREAM_OPEN
(1 << 0)
define
SHFS_STREAM_READ
(1 << 1)
define
SHFS_STREAM_WRITE
(1 << 2)
define
SHFS_STREAM_FSALLOC
(1 << 3)
define
SHFS_STREAM_DIRTY
(1 << 4)
define
SHFS_STREAM_CREATE
(1 << 6)
define
SHFS_STREAM_SYNC
(1 << 7)
Incremental writes cannot be made until a full write occurs.