pub struct TarHeader {
pub name: String,
pub mode: u32,
pub uid: u32,
pub gid: u32,
pub size: u64,
pub mtime: i64,
pub typeflag: u8,
pub linkname: String,
pub uname: String,
pub gname: String,
pub devmajor: u32,
pub devminor: u32,
}Expand description
Tar header information extracted from tar-split metadata.
Fields§
§name: StringFile path in the tar archive (e.g., “./etc/hosts”)
mode: u32File mode (permissions and type information)
uid: u32User ID of the file owner
gid: u32Group ID of the file owner
size: u64File size in bytes
mtime: i64Modification time (Unix timestamp)
typeflag: u8Tar entry type flag
linkname: StringLink target for symbolic links and hard links
uname: StringUser name of the file owner
gname: StringGroup name of the file owner
devmajor: u32Major device number (for device files)
devminor: u32Minor device number (for device files)
Implementations§
Source§impl TarHeader
impl TarHeader
Sourcepub fn from_bytes(header_bytes: &[u8]) -> Result<Self>
pub fn from_bytes(header_bytes: &[u8]) -> Result<Self>
Parse a TarHeader from a 512-byte TAR header block.
§Errors
Returns an error if the header is too short or has an invalid checksum.
Sourcepub fn is_regular_file(&self) -> bool
pub fn is_regular_file(&self) -> bool
Check if this header represents a regular file.
Sourcepub fn is_directory(&self) -> bool
pub fn is_directory(&self) -> bool
Check if this header represents a directory.
Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Check if this header represents a symbolic link.
Sourcepub fn is_hardlink(&self) -> bool
pub fn is_hardlink(&self) -> bool
Check if this header represents a hard link.
Sourcepub fn normalized_name(&self) -> &str
pub fn normalized_name(&self) -> &str
Normalize the path by stripping leading “./”