Struct tar_no_std::PosixHeader[][src]

#[repr(C, packed)]
pub struct PosixHeader {
Show 17 fields pub name: StaticCString<100>, pub mode: Mode, pub uid: [u8; 8], pub gid: [u8; 8], pub size: Size, pub mtime: [u8; 12], pub cksum: [u8; 8], pub typeflag: TypeFlag, pub linkname: StaticCString<100>, pub magic: StaticCString<6>, pub version: StaticCString<2>, pub uname: StaticCString<32>, pub gname: StaticCString<32>, pub dev_major: [u8; 8], pub dev_minor: [u8; 8], pub prefix: StaticCString<155>, pub _pad: [u8; 12],
}
Expand description

Header of the TAR format as specified by POSIX (POSIX 1003.1-1990. “New” (version?) GNU Tar versions use this archive format by default. (https://www.gnu.org/software/tar/manual/html_node/Formats.html#Formats).

Each file is started by such a header, that describes the size and the file name. After that, the file content stands in chunks of 512 bytes. The number of bytes can be derived from the file size.

This is also mostly compatible with the “Ustar”-header and the “GNU format”. Because this library only needs to fetch data and filename, we don’t need further checks.

Fields

name: StaticCString<100>

Name. There is always a null byte, therefore the max len is 99.

mode: Modeuid: [u8; 8]gid: [u8; 8]size: Sizemtime: [u8; 12]cksum: [u8; 8]typeflag: TypeFlaglinkname: StaticCString<100>

Name. There is always a null byte, therefore the max len is 99.

magic: StaticCString<6>version: StaticCString<2>uname: StaticCString<32>

Username. There is always a null byte, therefore the max len is N-1.

gname: StaticCString<32>

Groupname. There is always a null byte, therefore the max len is N-1.

dev_major: [u8; 8]dev_minor: [u8; 8]prefix: StaticCString<155>

There is always a null byte, therefore the max len is N-1.

_pad: [u8; 12]

Implementations

Returns the number of blocks that are required to read the whole file content.

A Tar archive is terminated, if a end-of-archive entry, which consists of two 512 blocks of zero bytes, is found.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.