2025-07-31 23:04:41 +01:00
|
|
|
|
=== Tape File Block (`TFLE`)
|
2025-07-31 20:27:32 +01:00
|
|
|
|
|
|
|
|
|
|
Lists all tape files.
|
|
|
|
|
|
Tape files are separations written to media, usually digital tapes, and are marked by filemarks.
|
|
|
|
|
|
|
|
|
|
|
|
==== Structure Definition
|
|
|
|
|
|
|
|
|
|
|
|
[source,c]
|
|
|
|
|
|
#define TAPE_FILE_MAGIC 0x454C4654
|
2025-10-11 13:17:26 +01:00
|
|
|
|
typedef struct TapeFileHeader
|
|
|
|
|
|
{
|
|
|
|
|
|
uint32_t identifier; ///< Block type identifier. Must be set to BlockType::TapeFileBlock. This magic value allows
|
|
|
|
|
|
///< parsers to identify the block type.
|
|
|
|
|
|
uint32_t entries; ///< Number of file entries following this header. Specifies how many TapeFileEntry structures
|
|
|
|
|
|
///< are in this block. Valid range: 0 to 2^32-1.
|
|
|
|
|
|
uint64_t length; ///< Size of entry data in bytes (excluding this header). Calculated as: entries ×
|
|
|
|
|
|
///< sizeof(TapeFileEntry). This is the number of bytes following the header.
|
|
|
|
|
|
uint64_t crc64; ///< CRC64-ECMA checksum of the entry data. Computed over the array of TapeFileEntry structures
|
|
|
|
|
|
///< only. Does NOT include this header. Used for integrity verification.
|
|
|
|
|
|
} TapeFileHeader;
|
2025-07-31 20:27:32 +01:00
|
|
|
|
|
|
|
|
|
|
==== Field Descriptions
|
|
|
|
|
|
|
|
|
|
|
|
[cols="2,2,2,6",options="header"]
|
|
|
|
|
|
|===
|
|
|
|
|
|
|Type
|
|
|
|
|
|
|Size
|
|
|
|
|
|
|Name
|
|
|
|
|
|
|Description
|
|
|
|
|
|
|
|
|
|
|
|
|uint32_t
|
|
|
|
|
|
|4 bytes
|
|
|
|
|
|
|identifier
|
|
|
|
|
|
|The tape file block identifier, always `TFLE`
|
|
|
|
|
|
|
|
|
|
|
|
|uint16_t
|
|
|
|
|
|
|2 bytes
|
|
|
|
|
|
|entries
|
|
|
|
|
|
|The number of entries following this header
|
|
|
|
|
|
|
|
|
|
|
|
|uint32_t
|
|
|
|
|
|
|4 bytes
|
|
|
|
|
|
|length
|
|
|
|
|
|
|The length in bytes of the data following this header.
|
|
|
|
|
|
|
|
|
|
|
|
|uint64_t
|
|
|
|
|
|
|8 bytes
|
|
|
|
|
|
|crc64
|
|
|
|
|
|
|The CRC64-ECMA checksum of the data following this header
|
|
|
|
|
|
|===
|
|
|
|
|
|
|
|
|
|
|
|
==== Tape file entries
|
|
|
|
|
|
|
|
|
|
|
|
[source,c]
|
2025-10-11 13:17:26 +01:00
|
|
|
|
typedef struct TapeFileEntry
|
|
|
|
|
|
{
|
|
|
|
|
|
uint32_t File; ///< File number (unique within the partition). Identifies this file among all files in the same
|
|
|
|
|
|
///< partition. Numbering scheme is tape-format-dependent.
|
|
|
|
|
|
uint8_t Partition; ///< Partition number containing this file. References a partition defined in the
|
|
|
|
|
|
///< TapePartitionHeader block. Valid range: 0-255.
|
|
|
|
|
|
uint64_t FirstBlock; ///< First block of the file (inclusive). This is the starting block address of the file data.
|
|
|
|
|
|
///< Block addresses are 0-based within the partition.
|
|
|
|
|
|
uint64_t
|
|
|
|
|
|
LastBlock; ///< Last block of the file (inclusive). This is the ending block address of the file data. Must be
|
|
|
|
|
|
///< ≥ FirstBlock. The file contains all blocks from FirstBlock through LastBlock inclusive.
|
|
|
|
|
|
} TapeFileEntry;
|
2025-07-31 20:27:32 +01:00
|
|
|
|
|
|
|
|
|
|
==== Field Descriptions
|
|
|
|
|
|
|
|
|
|
|
|
[cols="2,2,2,6",options="header"]
|
|
|
|
|
|
|===
|
|
|
|
|
|
|Type
|
|
|
|
|
|
|Size
|
|
|
|
|
|
|Name
|
|
|
|
|
|
|Description
|
|
|
|
|
|
|
|
|
|
|
|
|uint32
|
|
|
|
|
|
|4 bytes
|
|
|
|
|
|
|file
|
|
|
|
|
|
|File number.
|
|
|
|
|
|
|
|
|
|
|
|
|uint8
|
|
|
|
|
|
|1 byte
|
|
|
|
|
|
|partition
|
|
|
|
|
|
|Partition number this file belongs to.
|
|
|
|
|
|
|
|
|
|
|
|
|uint64
|
|
|
|
|
|
|8 bytes
|
|
|
|
|
|
|firstBlock
|
|
|
|
|
|
|First block number, inclusive, of the file.
|
|
|
|
|
|
|
|
|
|
|
|
|uint64
|
|
|
|
|
|
|8 bytes
|
|
|
|
|
|
|lastBlock
|
|
|
|
|
|
|Last block number, inclusive, of the file.
|
|
|
|
|
|
|===
|