tarfile
POSIX ustar Tar Archive Format
Functions
| Function | Description |
|---|---|
_tar_byte_at | Internal byte reader. |
_tar_write_octal | Internal: write octal string (zero-padded, len chars) at position. Writes rig… |
_tar_read_octal | Internal: read octal number from buffer. |
_tar_checksum | Internal: compute header checksum. |
_tar_zero_block | Internal: zero-fill a 512-byte block. |
tar_create | Create a write handle. out is the output buffer. |
tar_add_file | Add a file entry to the tar archive. |
tar_finish | Write two zero blocks to finish the archive. Returns total length. |
tar_open | Open a tar archive for reading. |
tar_next | Advance to next entry. Returns 1 if entry found, 0 if end of archive. |
tar_entry_name | Copy current entry name to out. Returns length. |
tar_entry_size | Get size of current entry data. |
tar_entry_data | Copy current entry data to out. Returns length. |
Details
_tar_byte_at
fn _tar_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
_tar_write_octal
fn _tar_write_octal(out: &i8, pos: i64, val: i64, len: i64) -> i64Internal: write octal string (zero-padded, len chars) at position. Writes right-to-left directly into output to avoid alloc_pages.
_tar_read_octal
fn _tar_read_octal(buf: &i8, pos: i64, len: i64) -> i64Internal: read octal number from buffer.
_tar_checksum
fn _tar_checksum(buf: &i8, pos: i64) -> i64Internal: compute header checksum.
_tar_zero_block
fn _tar_zero_block(buf: &i8, pos: i64) -> i64Internal: zero-fill a 512-byte block.
tar_create
fn tar_create(out: &i8) -> &i64Create a write handle. out is the output buffer.
tar_add_file
fn tar_add_file(h: &i64, name: &i8, nlen: i64, data: &i8, dlen: i64) -> i64Add a file entry to the tar archive.
tar_finish
fn tar_finish(h: &i64) -> i64Write two zero blocks to finish the archive. Returns total length.
tar_open
fn tar_open(buf: &i8, len: i64) -> &i64Open a tar archive for reading.
tar_next
fn tar_next(h: &i64) -> i64Advance to next entry. Returns 1 if entry found, 0 if end of archive.
tar_entry_name
fn tar_entry_name(h: &i64, out: &i8) -> i64Copy current entry name to out. Returns length.
tar_entry_size
fn tar_entry_size(h: &i64) -> i64Get size of current entry data.
tar_entry_data
fn tar_entry_data(h: &i64, out: &i8) -> i64Copy current entry data to out. Returns length.