GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > FILE / V3-8-0
Constituent: file_path     Tag: mv2304
#include "FILE/FILE_path_msg.h"
#include "FILE/FILE_defs.h"
#include <sys/types.h>
Include dependency graph for FILE_path.h:
This graph shows which files directly or indirectly include this file:
Defines | |
#define | FILE_M_MODULE ( 0x0200 ) |
Module number in the errno sense. | |
#define | FILE_S_SUCCESS ( FILE_M_MODULE | 0x0000 ) |
File opened successfully (not a read-only request). | |
#define | FILE_S_NOHED ( FILE_M_MODULE | 0x0004 ) |
File opened successfully (no FSW header found). | |
#define | FILE_S_HEDNOCMP ( FILE_M_MODULE | 0x0008 ) |
File opened successfully (FSW header found, file not compressed). | |
#define | FILE_S_HEDCMP ( FILE_M_MODULE | 0x000c ) |
File opened successfully (FSW header found, file compressed). | |
#define | FILE_E_CORRUPT ( FILE_M_MODULE | 0x0003 ) |
File open failed (the adler32 checksum of the body failed). | |
#define | FILE_E_NOMKDIR ( FILE_M_MODULE | 0x0007 ) |
File open failed (could not create directory for temporary file). | |
#define | FILE_E_NOSLOT ( FILE_M_MODULE | 0x000b ) |
File open failed (no more slots to store temporary file info). | |
#define | FILE_E_NOTMPOPN ( FILE_M_MODULE | 0x000f ) |
File open failed (could not open temporary file). | |
#define | FILE_E_NOINFLAT ( FILE_M_MODULE | 0x0013 ) |
File open failed (inflation step failed). | |
#define | FILE_E_NOREOPEN ( FILE_M_MODULE | 0x0017 ) |
File open failed (could not reopen temporary file read-only). | |
Functions | |
unsigned int | FILE_pathInit (const char *usrName5, const char *usrName6) |
Initialize the file path mapping library. | |
unsigned int | FILE_pathSizeof (void) |
Get the size of a file path string. | |
unsigned int | FILE_pathIdToNum (unsigned int id, unsigned int *dev, unsigned int *dir, unsigned int *file) |
Translates a file ID word into component numbers. | |
unsigned int | FILE_pathNumToId (unsigned int *id, unsigned int dev, unsigned int dir, unsigned int file) |
Translates file component numbers to an ID word. | |
unsigned int | FILE_pathIdToPath (unsigned int id, char *str) |
Translates file ID word to an ASCII path name. | |
int | FILE_close (int fid) |
Close a FSW file (regular, headed/not-headed, compressed/not-compressed). | |
int | FILE_open (const char *fil, int opt, mode_t mod) |
Open a FSW file (regular, headed/not-headed, compressed/not-compressed). |
|
Close a FSW file (regular, headed/not-headed, compressed/not-compressed).
|
|
Open a FSW file (regular, headed/not-headed, compressed/not-compressed).
Flight software files appear in three different formats:
When FILE_open() is asked to open any of these formats, it will first inspect the file to classify it. The adler32 checksum in the header is very powerful here. Subsequent processing depends on the file format:
In keeping with the idea that FILE_open() is modeled on open(), the errno method is used to return extra information. One unusual feature of this is that errno can contain helpful information, even when the file open is successful. If the return value is not -1 (i.e. the open succeeded), errno can contain:
If the return value is -1 (i.e. the open failed), errno, in addition to any of the regular values that open() can return, can contain:
If you wish to use these values for additional checking, note that errno is a four byte word encoded as two two-byte units. The most significant unit is a module number and the lower unit is the "error" number. The additional error codes defined by FILE_open() are module 0x200 (to avoid collisions with unix and VxWorks error codes), and the error numbers obey MSG conventions, i.e. if the least significant bit is clear, the operation was a success. |
|
Translates a file ID word into component numbers. Breaks a file ID word into its numerical components, which are stored in the user supplied dev, dir, and file locations.
|
|
Translates file ID word to an ASCII path name. Creates a file system path string from a set of file ID components. The result is stored in the user supplied str location. The resulting path string is appropriate for use with the file system API functions.
|
|
Initialize the file path mapping library. Sets the root partition names for device numbers '5' and '6' (FILE_DEV_NUM_USR0 and FILE_DEV_NUM_USR1). The names from usrName5 and usrName6 will be used when calling function FILE_pathIdToPath().
|
|
Translates file component numbers to an ID word. Composes a new file ID word from its numerical components. The result is stored in the user supplied id location.
|
|
Get the size of a file path string. Returns the number of bytes needed to hold an on-board file path string.
|