|
FILE* drms_segment_fopen |
( |
DRMS_Segment_t * |
seg, |
|
|
const char * |
newfilename, |
|
|
int |
append, |
|
|
int * |
status | |
|
) |
| | |
Opens the data file associated with the segment seg. A FILE * to the opened file is returned. The caller must close the FILE * with drms_segment_fclose.
- Parameters:
-
| seg | The segments whose file is to be opened. |
| newfilename | If the storage unit referenced by the segment is a DRMS_READWRITE storage unit and the caller intends to write a file that does not yet exist, newfilename will be the name of the new file. Otherwise, the new file will be given a default name formed from a combination of the segment name and the protocol type. |
| append | If the storage unit referenced by the segment is a DRMS_READWRITE storage unit, and append is set to 1, then when the segment's file is opened, the writing stream pointer is positioned at the end of the file (the reading stream pointer is positioned at the beginning of the file). |
| status | DRMS status returned by reference. If the SUNUM referenced by the segment is not known to SUMS, then a status of DRMS_ERROR_NOSTORAGEUNIT is returned. If the storage unit referenced by the segment is invalid or contains unrecognized data, DRMS_ERROR_INVALIDSU is returned. If the file referenced by the segment cannot be found or opened, DRMS_ERROR_INVALIDFILE is returned. |
Definition at line 853 of file drms_segment.c.
|