Loading...
Searching...
No Matches
TapeFileEntry Struct Reference

Describes a single logical file on a tape medium. More...

`#include <aaruformat/structs/tape.h>`

## Data Fields

uint32_t | File
| File number (unique within the partition).
uint8_t | Partition
| Partition number containing this file.
uint64_t | FirstBlock
| First block of the file (inclusive).
uint64_t | LastBlock
| Last block of the file (inclusive).

## Detailed Description

Describes a single logical file on a tape medium.

A tape file is a contiguous sequence of blocks that represents a discrete logical unit of data. Files are the primary organizational unit on tape media, analogous to files on a filesystem but simpler in structure. Each file is identified by a file number and exists within a specific partition.

File Number: The file number uniquely identifies the file within its partition. File numbering typically starts from 0 or 1 depending on the tape format. Sequential files are numbered consecutively, though gaps may exist if files were deleted or the tape was formatted with specific file positions reserved.

Partition Association: Each file belongs to exactly one partition. Multi-partition tapes can have files with the same file number in different partitions - the combination of partition number and file number uniquely identifies a file on the tape.

Block Range: The FirstBlock and LastBlock fields define the inclusive range of blocks that comprise the file. Both endpoints are included in the file. For example:

- FirstBlock=0, LastBlock=0: A single-block file (block 0)
- FirstBlock=10, LastBlock=19: A ten-block file (blocks 10-19 inclusive)
- FirstBlock=100, LastBlock=99: Invalid (FirstBlock must be ≤ LastBlock)

Physical Layout: Files occupy contiguous blocks on tape. There are no block pointers or allocation tables as found in disk filesystems. The physical ordering matches the logical ordering defined by the block range.

File Marks: On physical tape, files are typically separated by filemarks (also called tape marks). This structure represents the logical file boundaries; the actual filemarks may be implicit in the block numbering or explicitly stored in the tape data stream.

Size Calculation: File size in blocks = (LastBlock - FirstBlock + 1) File size in bytes = file_size_in_blocks × block_size (where block_size is tape-format-specific, commonly 512, 1024, or variable)

Note
  File numbers and block addresses are format-specific. Some formats use 0-based numbering while others use 1-based. The Aaru format preserves the original numbering scheme.
  Files cannot span partitions. If a logical dataset crosses partition boundaries, it would be represented as separate files in each partition.
  Empty files (where FirstBlock == LastBlock but containing no data) may exist on some tape formats to serve as markers or placeholders.

Definition at line 133 of file tape.h.

## Field Documentation

## File

uint32_t TapeFileEntry::File

File number (unique within the partition).

Identifies this file among all files in the same partition. Numbering scheme is tape-format-dependent.

Definition at line 135 of file tape.h.

Referenced by aaruf_set_tape_file().

## FirstBlock

uint64_t TapeFileEntry::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.

Definition at line 139 of file tape.h.

Referenced by aaruf_get_tape_file(), and aaruf_set_tape_file().

## LastBlock

uint64_t TapeFileEntry::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.

Definition at line 142 of file tape.h.

Referenced by aaruf_get_tape_file(), and aaruf_set_tape_file().

## Partition

uint8_t TapeFileEntry::Partition

Partition number containing this file.

References a partition defined in the TapePartitionHeader block. Valid range: 0-255.

Definition at line 137 of file tape.h.

Referenced by aaruf_set_tape_file().

The documentation for this struct was generated from the following file:

- include/aaruformat/structs/tape.h