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