ECP-VELOC Components
User documentation for all components
|
some I/O utilities More...
Go to the source code of this file.
Functions | |
Basic File I/O | |
mode_t | shuffile_getmode (int read, int write, int execute) |
int | shuffile_open (const char *file, int flags,...) |
int | shuffile_close (const char *file, int fd) |
int | shuffile_file_lock_read (const char *file, int fd) |
int | shuffile_file_lock_write (const char *file, int fd) |
int | shuffile_file_unlock (const char *file, int fd) |
int | shuffile_open_with_lock (const char *file, int flags, mode_t mode) |
int | shuffile_close_with_unlock (const char *file, int fd) |
int | shuffile_lseek (const char *file, int fd, off_t pos, int whence) |
ssize_t | shuffile_read (const char *file, int fd, void *buf, size_t size) |
ssize_t | shuffile_write (const char *file, int fd, const void *buf, size_t size) |
ssize_t | shuffile_read_attempt (const char *file, int fd, void *buf, size_t size) |
ssize_t | shuffile_write_attempt (const char *file, int fd, const void *buf, size_t size) |
ssize_t | shuffile_read_line (const char *file, int fd, char *buf, size_t size) |
ssize_t | shuffile_writef (const char *file, int fd, const char *format,...) |
int | shuffile_read_pad_n (int n, const char **files, int *fds, char *buf, unsigned long count, unsigned long offset, unsigned long *filesizes) |
int | shuffile_write_pad_n (int n, const char **files, int *fds, char *buf, unsigned long count, unsigned long offset, unsigned long *filesizes) |
int | shuffile_stat (const char *file, struct stat *statbuf) |
unsigned long | shuffile_file_size (const char *file) |
int | shuffile_file_exists (const char *file) |
int | shuffile_file_is_readable (const char *file) |
int | shuffile_file_is_writeable (const char *file) |
int | shuffile_file_unlink (const char *file) |
int | shuffile_crc32 (const char *filename, uLong *crc) |
Directory functions | |
int | shuffile_mkdir (const char *dir, mode_t mode) |
int | shuffile_rmdir (const char *dir) |
int | shuffile_getcwd (char *buf, size_t size) |
File Copy Functions | |
int | shuffile_file_copy (const char *src_file, const char *dst_file, unsigned long buf_size, uLong *crc) |
File compression functions | |
int | shuffile_compress_in_place (const char *file_src, const char *file_dst, unsigned long block_size, int level) |
int | shuffile_uncompress_in_place (const char *file_src, const char *file_dst) |
int | shuffile_compress (const char *file_src, const char *file_dst, unsigned long block_size, int level) |
int | shuffile_uncompress (const char *file_src, const char *file_dst) |
int shuffile_close | ( | const char * | file, |
int | fd | ||
) |
close file with an fsync
int shuffile_close_with_unlock | ( | const char * | file, |
int | fd | ||
) |
unlocks the specified file descriptor and then closes the file
int shuffile_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 shuffile_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 shuffile_crc32 | ( | const char * | filename, |
uLong * | crc | ||
) |
opens, reads, and computes the crc32 value for the given filename
int shuffile_file_copy | ( | const char * | src_file, |
const char * | dst_file, | ||
unsigned long | buf_size, | ||
uLong * | crc | ||
) |
int shuffile_file_exists | ( | const char * | file | ) |
tests whether the file or directory exists
int shuffile_file_is_readable | ( | const char * | file | ) |
tests whether the file or directory is readable
int shuffile_file_is_writeable | ( | const char * | file | ) |
tests whether the file or directory is writeable
int shuffile_file_lock_read | ( | const char * | file, |
int | fd | ||
) |
get and release file locks
int shuffile_file_lock_write | ( | const char * | file, |
int | fd | ||
) |
unsigned long shuffile_file_size | ( | const char * | file | ) |
given a filename, return number of bytes in file
int shuffile_file_unlink | ( | const char * | file | ) |
delete a file
int shuffile_file_unlock | ( | const char * | file, |
int | fd | ||
) |
int shuffile_getcwd | ( | char * | buf, |
size_t | size | ||
) |
write current working directory to buf
mode_t shuffile_getmode | ( | int | read, |
int | write, | ||
int | execute | ||
) |
returns user's current mode as determine by his umask
int shuffile_lseek | ( | const char * | file, |
int | fd, | ||
off_t | pos, | ||
int | whence | ||
) |
seek file descriptor to specified position
int shuffile_mkdir | ( | const char * | dir, |
mode_t | mode | ||
) |
recursively create directory and subdirectories
int shuffile_open | ( | const char * | file, |
int | flags, | ||
... | |||
) |
open file with specified flags and mode, retry open a few times on failure
int shuffile_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 shuffile_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 shuffile_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 shuffile_read_line | ( | const char * | file, |
int | fd, | ||
char * | buf, | ||
size_t | size | ||
) |
read line from file into buf with given size
int shuffile_read_pad_n | ( | int | n, |
const char ** | files, | ||
int * | fds, | ||
char * | buf, | ||
unsigned long | count, | ||
unsigned long | offset, | ||
unsigned long * | filesizes | ||
) |
logically concatenate n opened files and read count bytes from this logical file into buf starting from offset, pad with zero on end if missing data
int shuffile_rmdir | ( | const char * | dir | ) |
remove directory
int shuffile_stat | ( | const char * | file, |
struct stat * | statbuf | ||
) |
given a filename, return stat info
int shuffile_uncompress | ( | const char * | file_src, |
const char * | file_dst | ||
) |
uncompress the specified file and store as file_dst
int shuffile_uncompress_in_place | ( | const char * | file_src, |
const char * | file_dst | ||
) |
uncompress the specified file and store as file_dst
ssize_t shuffile_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 shuffile_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)
int shuffile_write_pad_n | ( | int | n, |
const char ** | files, | ||
int * | fds, | ||
char * | buf, | ||
unsigned long | count, | ||
unsigned long | offset, | ||
unsigned long * | filesizes | ||
) |
write to an array of open files with known filesizes and treat them as one single large file
ssize_t shuffile_writef | ( | const char * | file, |
int | fd, | ||
const char * | format, | ||
... | |||
) |
write a formatted string to specified file descriptor