I'm working in a lib for raeding and writing tar files. You can find the source here (https://gitlab.com/JakobDev/Computercraft/-/blob/master/Modules/tarlib.lua). The only problem, is that I don't know how to create the checksum for the header record (https://en.wikipedia.org/wiki/Tar_(computing)#Header). The other things are working. Does anybody know that?
I would look at how another (open source) implementation does this or look for the file format specification.