<trclass="memdesc:a319aea86a448c0b969de944f22e551c0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Number of file entries following this header. <br/></td></tr>
<trclass="memdesc:a74b5289640a6c45eece7bd58550e59c0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Size of entry data in bytes (excluding this header). <br/></td></tr>
<trclass="memdesc:a5172ee4bf0b5820a66d04aff1e3809db"><tdclass="mdescLeft"> </td><tdclass="mdescRight">CRC64-ECMA checksum of the entry data. <br/></td></tr>
<divclass="textblock"><p>Header for a tape file metadata block containing file layout information. </p>
<p>This structure serves as the header for a TapeFileBlock, which documents all logical files present on the tape medium. The block consists of this fixed-size header followed by a variable-length array of <aclass="el"href="structTapeFileEntry.html"title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures (one per file).</p>
<divclass="ttc"id="astructTapeFileEntry_html"><divclass="ttname"><ahref="structTapeFileEntry.html">TapeFileEntry</a></div><divclass="ttdoc">Describes a single logical file on a tape medium.</div><divclass="ttdef"><b>Definition</b><ahref="tape_8h_source.html#l00133">tape.h:134</a></div></div>
<divclass="ttc"id="astructTapeFileHeader_html"><divclass="ttname"><ahref="structTapeFileHeader.html">TapeFileHeader</a></div><divclass="ttdoc">Header for a tape file metadata block containing file layout information.</div><divclass="ttdef"><b>Definition</b><ahref="tape_8h_source.html#l00237">tape.h:238</a></div></div>
</div><!-- fragment --><p><b>Purpose:</b> The tape file block enables:</p><ul>
<li>Quick lookup of file locations without scanning the entire tape</li>
<li>Validation of file boundaries and partition assignments</li>
<li>Random access to specific files in the image</li>
<li>Preservation of the original tape's logical organization</li>
<li>Documentation of tape structure for archival purposes</li>
</ul>
<p><b>Identifier Field:</b> The identifier field must be set to BlockType::TapeFileBlock to indicate this block type. This allows the Aaru format parser to recognize and correctly interpret the block during image loading.</p>
<p><b>Entry Count:</b> The entries field specifies the number of <aclass="el"href="structTapeFileEntry.html"title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures that follow the header. A tape with no files would have entries=0, though this is unusual. Maximum value is 2^32-1 (4,294,967,295 files), though practical limits are much lower.</p>
<p><b>Block Length:</b> The length field contains the size in bytes of the data following this header (i.e., the array of <aclass="el"href="structTapeFileEntry.html"title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures). This is calculated as: length = entries × sizeof(TapeFileEntry)</p>
<p>The header itself is NOT included in the length value. Total block size is: total_size = sizeof(TapeFileHeader) + length</p>
<p><b>CRC64 Checksum:</b> The crc64 field contains a CRC64-ECMA checksum computed over the entry data (the array of <aclass="el"href="structTapeFileEntry.html"title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures, excluding this header). This provides integrity verification to detect corruption in the file table. The CRC is calculated using the ECMA polynomial.</p>
<p><b>File Order:</b> Entries should be ordered by partition number (ascending), then by file number (ascending) within each partition. This ordering facilitates efficient lookup and matches the physical organization of most tape formats.</p>
<p><b>Alignment:</b> When written to the Aaru image, this block is aligned to the image's block alignment boundary (typically 2^blockAlignmentShift bytes). Padding may be inserted before the block to achieve proper alignment.</p>
<p><b>Index Integration:</b> After writing this block to the image file, an <aclass="el"href="structIndexEntry.html"title="Single index entry describing a block's type, (optional) data classification, and file offset.">IndexEntry</a> is created with:</p><ul>
<li>blockType = TapeFileBlock</li>
<li>dataType = 0 (tape file blocks have no subtype)</li>
<li>offset = file position where this header was written</li>
</ul>
<dlclass="section note"><dt>Note</dt><dd>This block is optional. Tape images without file structure metadata can omit it, representing the tape as a simple linear sequence of blocks.</dd>
<dd>
If a tape has multiple partitions, files from all partitions are included in a single TapeFileBlock (distinguished by their Partition field).</dd>
<dd>
Empty tapes (no files) may still have a <aclass="el"href="structTapeFileHeader.html"title="Header for a tape file metadata block containing file layout information.">TapeFileHeader</a> with entries=0, length=0, though such blocks are typically omitted.</dd></dl>
<dlclass="section warning"><dt>Warning</dt><dd>The entries count must accurately reflect the number of <aclass="el"href="structTapeFileEntry.html"title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures in the block. Mismatches will cause parsing errors.</dd>
<dd>
The CRC64 must be recalculated any time the entry data changes. Stale CRC values will cause integrity check failures.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="structTapeFileEntry.html"title="Describes a single logical file on a tape medium.">TapeFileEntry</a> for the structure of individual file <aclass="el"href="#a319aea86a448c0b969de944f22e551c0"title="Number of file entries following this header.">entries</a></dd>
<dd>
<aclass="el"href="structTapePartitionHeader.html"title="Header for a tape partition metadata block containing partition layout information.">TapePartitionHeader</a> for partition structure metadata </dd>
<dd>
<aclass="el"href="enums_8h.html#a54420623f26ab6bb61042b41cccf37a3"title="List of known block types contained in an Aaru image.">BlockType</a> for block type <aclass="el"href="#a36fe923f8d67004e0b0ae8eaf6535e1d"title="Block type identifier.">identifier</a> constants </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00237">237</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<p>Computed over the array of <aclass="el"href="structTapeFileEntry.html"title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures only. Does NOT include this header. Used for integrity verification. </p>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00245">245</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="tape_8c_source.html#l00126">process_tape_files_block()</a>, and <aclass="el"href="close_8c_source.html#l02724">write_tape_file_block()</a>.</p>
<p>Number of file entries following this header. </p>
<p>Specifies how many <aclass="el"href="structTapeFileEntry.html"title="Describes a single logical file on a tape medium.">TapeFileEntry</a> structures are in this block. Valid range: 0 to 2^32-1. </p>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00241">241</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="tape_8c_source.html#l00126">process_tape_files_block()</a>.</p>
<p>Must be set to BlockType::TapeFileBlock. This magic value allows parsers to identify the block type. </p>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00239">239</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="tape_8c_source.html#l00126">process_tape_files_block()</a>, and <aclass="el"href="close_8c_source.html#l02724">write_tape_file_block()</a>.</p>
<p>Size of entry data in bytes (excluding this header). </p>
<p>Calculated as: entries × sizeof(TapeFileEntry). This is the number of bytes following the header. </p>
<pclass="definition">Definition at line <aclass="el"href="tape_8h_source.html#l00243">243</a> of file <aclass="el"href="tape_8h_source.html">tape.h</a>.</p>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.14.0 </li>