GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / V9-1-3 > latc_host / rhel4-32
#include <fio_p.h>
Functions | |
unsigned | file_create (File *file, const char *name) |
Create a new file and insert version information. | |
unsigned | file_write (File *file, void *ptr, int nword) |
Copies size bytes from ptr into the file buffer, flushing the buffer if it fills. | |
unsigned | file_vwrite (File *file, FileElement *vec, int n) |
Performs a series of n file write operations using size and pointer information held in the array of file elements, vec. | |
unsigned | file_flush (File *file) |
Checks that this is a write file and that there is data in the buffer, then byteswaps to big-endianness and writes the full FIO_BUF_SIZE bytes of the buffer to disk. | |
unsigned | file_finish (File *file) |
Performs a final flush of the buffer (if needed) and closes the file. |
unsigned file_create | ( | File * | file, | |
const char * | name | |||
) |
Create a new file and insert version information.
file | Pointer to the structure to use for this file descriptor | |
name | Full pathname of the file to open |
LATC_SUCCESS | if the file opens successfully for writing | |
LATC_BADFOPEN | if the file fails to open |
References _File::fd, and _File::mode.
Referenced by LATC_createFile(), and LATC_createMap().
unsigned file_finish | ( | File * | file | ) |
Performs a final flush of the buffer (if needed) and closes the file.
file | Pointer to a File structure that has been initialised with file_open_w or file_open_r |
LATC_BADWRITE | if the final write of the buffer failed | |
LATC_BADCLOSE | if the file close failed | |
LATC_SUCCESS | if all goes well |
References _File::fd, and file_flush().
Referenced by LATC_createFile(), and LATC_createMap().
unsigned file_flush | ( | File * | file | ) |
Checks that this is a write file and that there is data in the buffer, then byteswaps to big-endianness and writes the full FIO_BUF_SIZE bytes of the buffer to disk.
file | Pointer to a File structure that has been initialised with file_open_w (although just returns LATC_SUCCESS if used on a file opened for reading) |
LATC_BADWRITE | if the buffer fails to write | |
LATC_SUCCESS | if all goes well |
References _File::buffer, _File::fd, _File::mode, and _File::used.
Referenced by file_finish(), and file_write().
unsigned file_vwrite | ( | File * | file, | |
FileElement * | vec, | |||
int | n | |||
) |
Performs a series of n file write operations using size and pointer information held in the array of file elements, vec.
file | Pointer to a file structure that has been initialised with file_open_w | |
vec | Array of FileElement structures listing fragments to write and their sizes | |
n | Number of elements in the array |
LATC_BADWRITE | if file_flush is called and fails | |
LATC_READONLY | if called using a file that was opened for read-only | |
LATC_SUCCESS | if all goes well. |
References _FileElement::done, and file_write().
unsigned file_write | ( | File * | file, | |
void * | ptr, | |||
int | nword | |||
) |
Copies size bytes from ptr into the file buffer, flushing the buffer if it fills.
file | Pointer to a file structure that has been initialised with file_open_w. | |
nword | Number of 32 bit words in the block to write | |
ptr | Pointer to the block to write to the file |
LATC_BADWRITE | if file_flush is called and fails | |
LATC_READONLY | if called using a file that was opened for read-only | |
LATC_SUCCESS | if all goes well. |
References _File::buffer, _File::fd, file_flush(), _File::mode, and _File::used.
Referenced by file_vwrite(), LATC_createFile(), and LATC_createMap().