Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement lighter-weight archive format #229

Open
JonathonReinhart opened this issue Aug 7, 2022 · 0 comments
Open

Implement lighter-weight archive format #229

JonathonReinhart opened this issue Aug 7, 2022 · 0 comments

Comments

@JonathonReinhart
Copy link
Owner

JonathonReinhart commented Aug 7, 2022

I've wasted so much time hacking on/around libtar, that it would have made more sense to implement our own lightweight format.

  • Python writer (and probably reader for debugging)
  • C reader for extraction

The format would be focused on a fast, simple C extractor.

I'm thinking something like this:

File header:

Offset Size Type Name Description
0 4 uint32 magic Sanity check

(We don't need a version or flags, since the archive is attached to the extractor)

Entry:

Offset Size Type Name Description
0 1 uint8 ent_type Entry type (1 = file, 2 = symlink)
1 1 uint8 comp_type Data compression type (0 = none, 1 = lzma )
2 2 uint16 name_len Length of filename
4 4 uint32 data_len Length of data
8 name_len utf8_string name Filename / path
8 + name_len data_len raw data Raw data (may be compressed)
Filie data or symlink target path

We don't need uid/gid/timestamps or any of that crap. The only thing we may need is executable, but we could just as easily set everything executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant