ECP-VELOC Components
User documentation for all components
|
I/O functions. More...
Go to the source code of this file.
Functions | |
Basic File I/O | |
mode_t | redset_getmode (int read, int write, int execute) |
int | redset_open (const char *file, int flags,...) |
int | redset_close (const char *file, int fd) |
int | redset_file_lock_read (const char *file, int fd) |
int | redset_file_lock_write (const char *file, int fd) |
int | redset_file_unlock (const char *file, int fd) |
int | redset_open_with_lock (const char *file, int flags, mode_t mode) |
int | redset_close_with_unlock (const char *file, int fd) |
int | redset_lseek (const char *file, int fd, off_t pos, int whence) |
ssize_t | redset_read (const char *file, int fd, void *buf, size_t size) |
ssize_t | redset_write (const char *file, int fd, const void *buf, size_t size) |
ssize_t | redset_read_attempt (const char *file, int fd, void *buf, size_t size) |
ssize_t | redset_write_attempt (const char *file, int fd, const void *buf, size_t size) |
ssize_t | redset_read_line (const char *file, int fd, char *buf, size_t size) |
ssize_t | redset_writef (const char *file, int fd, const char *format,...) |
int | redset_stat (const char *file, struct stat *statbuf) |
unsigned long | redset_file_size (const char *file) |
int | redset_file_exists (const char *file) |
int | redset_file_is_readable (const char *file) |
int | redset_file_is_writeable (const char *file) |
int | redset_file_unlink (const char *file) |
int | redset_crc32 (const char *filename, uLong *crc) |
Directory functions | |
int | redset_mkdir (const char *dir, mode_t mode) |
int | redset_rmdir (const char *dir) |
int | redset_getcwd (char *buf, size_t size) |
File Copy Functions | |
int | redset_file_copy (const char *src_file, const char *dst_file, unsigned long buf_size, uLong *crc) |
File compression functions | |
int | redset_compress_in_place (const char *file_src, const char *file_dst, unsigned long block_size, int level) |
int | redset_uncompress_in_place (const char *file_src, const char *file_dst) |
int | redset_compress (const char *file_src, const char *file_dst, unsigned long block_size, int level) |
int | redset_uncompress (const char *file_src, const char *file_dst) |
int redset_close | ( | const char * | file, |
int | fd | ||
) |
close file with an fsync
int redset_close_with_unlock | ( | const char * | file, |
int | fd | ||
) |
unlocks the specified file descriptor and then closes the file
int redset_compress | ( | const char * | file_src, |
const char * | file_dst, | ||
unsigned long | block_size, | ||
int | level | ||
) |
compress the specified file using blocks of size block_size and store as file_dst
int redset_compress_in_place | ( | const char * | file_src, |
const char * | file_dst, | ||
unsigned long | block_size, | ||
int | level | ||
) |
compress the specified file using blocks of size block_size and store as file_dst
int redset_crc32 | ( | const char * | filename, |
uLong * | crc | ||
) |
opens, reads, and computes the crc32 value for the given filename
int redset_file_copy | ( | const char * | src_file, |
const char * | dst_file, | ||
unsigned long | buf_size, | ||
uLong * | crc | ||
) |
int redset_file_exists | ( | const char * | file | ) |
tests whether the file or directory exists
int redset_file_is_readable | ( | const char * | file | ) |
tests whether the file or directory is readable
int redset_file_is_writeable | ( | const char * | file | ) |
tests whether the file or directory is writeable
int redset_file_lock_read | ( | const char * | file, |
int | fd | ||
) |
get and release file locks
int redset_file_lock_write | ( | const char * | file, |
int | fd | ||
) |
unsigned long redset_file_size | ( | const char * | file | ) |
given a filename, return number of bytes in file
int redset_file_unlink | ( | const char * | file | ) |
delete a file
int redset_file_unlock | ( | const char * | file, |
int | fd | ||
) |
int redset_getcwd | ( | char * | buf, |
size_t | size | ||
) |
write current working directory to buf
mode_t redset_getmode | ( | int | read, |
int | write, | ||
int | execute | ||
) |
returns user's current mode as determine by his umask
int redset_lseek | ( | const char * | file, |
int | fd, | ||
off_t | pos, | ||
int | whence | ||
) |
seek file descriptor to specified position
int redset_mkdir | ( | const char * | dir, |
mode_t | mode | ||
) |
recursively create directory and subdirectories
int redset_open | ( | const char * | file, |
int | flags, | ||
... | |||
) |
open file with specified flags and mode, retry open a few times on failure
int redset_open_with_lock | ( | const char * | file, |
int | flags, | ||
mode_t | mode | ||
) |
opens specified file and waits on for an exclusive lock before returning the file descriptor
ssize_t redset_read | ( | const char * | file, |
int | fd, | ||
void * | buf, | ||
size_t | size | ||
) |
reliable read from opened file descriptor (retries, if necessary, until hard error)
ssize_t redset_read_attempt | ( | const char * | file, |
int | fd, | ||
void * | buf, | ||
size_t | size | ||
) |
make a good attempt to read from file (retries, if necessary, return error if fail)
ssize_t redset_read_line | ( | const char * | file, |
int | fd, | ||
char * | buf, | ||
size_t | size | ||
) |
read line from file into buf with given size
int redset_rmdir | ( | const char * | dir | ) |
remove directory
int redset_stat | ( | const char * | file, |
struct stat * | statbuf | ||
) |
given a filename, return stat info
int redset_uncompress | ( | const char * | file_src, |
const char * | file_dst | ||
) |
uncompress the specified file and store as file_dst
int redset_uncompress_in_place | ( | const char * | file_src, |
const char * | file_dst | ||
) |
uncompress the specified file and store as file_dst
ssize_t redset_write | ( | const char * | file, |
int | fd, | ||
const void * | buf, | ||
size_t | size | ||
) |
reliable write to opened file descriptor (retries, if necessary, until hard error)
ssize_t redset_write_attempt | ( | const char * | file, |
int | fd, | ||
const void * | buf, | ||
size_t | size | ||
) |
make a good attempt to write to file (retries, if necessary, return error if fail)
ssize_t redset_writef | ( | const char * | file, |
int | fd, | ||
const char * | format, | ||
... | |||
) |
write a formatted string to specified file descriptor