tar
and the tar formattar
for if I want to make a tar libraryio::Error
, not enums. It’s a library, so they
should be enumerated. Even internally, this is an issue: prepare_header_path
in builder.rs re-checks a condition, because it can’t introspect on errors.prepare_header
in builder.rs constructs a GNU-format header with
let mut header = Header::new_gnu();
, then immediately casts it to GNU with
header.as_gnu_mut().unwrap()
, which requires redundant checks and less type
safety. Instead, I would use the typestate pattern, with care to not inflate
code size via monomorphism.ArchiveInner
should be a bitset.Path
, OsString::from_encoded_bytes_unchecked
could be used with
appropriate sanitization first, to allow for more patterns of invalid UTF-8.I’d want to survey foundational implementations. Plan 9 tar is listed on Wikipedia as influential, so I could use my archival work there.
I’d want to make compatibility modes, for functioning as different implementations.
An in-depth Go issue describes the incorrect
assumptions made in archive/tar
, which is useful for a historical perspective
and survey (see the Reader
fix).
It mentions the commit introducing base-256 numbers into GNU tar in 1999.
Schily tar (star) by Jörg Schilling is an influential and early tar
implementation. Its man pages compare many
tar implementations (see artype
). Its source is on SourceForge in star,
and possibly also schilytools
which has more releases. FreshPorts
describes its benefits over other tar implementations.