GAMMASPHERE information, TAPE HEADER RECORD

The TAPE HEADER RECORD is defined as:
typedef struct tape_header
    {
    u_short RecordType;		/* tape header type= 1             */
    u_short RecordLength;	/* number of bytes in this record  */
    u_short RecordVer;		/* record version or subtype       */
    u_long  ByteOrder;		/* to determine byte ordering      */
    char    exp_title1[40];	/* first part of exp title         */
    char    exp_title2[40];	/* 2nd  part of exp title          */
    char    time[9];		/* hh:mm:ss			   */
    char    date[9];		/* yy/mm/dd			   */
    u_short TapeNum;		/* tape number in this experiment  */
    u_short  TapeUnit;		/* specifies which unit wrote this tape */
}       TAPE_HEADER;

The ByteOrder is written as: 0x01020304 and, at the moment, TapeNum is an arbitrary constant: 0xaaaa. Ushort is an unsigned short integer (16 bits).

On some computers the ByteOrder and the rest of the structure may not be read correctly due to memory aligment problems (there are tree two byte words before ByteOrder. It is the odd number of bytes that is the problem). The fix is to read the ByteOrder as two 16-bit words rather than one 32 bit word.


If you find errors in this GAMMASPHERE documentation; please send E-mail to Torben@anl.gov.