[Rubygems-developers] Bug in RubyGems/rpa-base's restricted implementation of tar?

Mauricio Fernández batsman.geo at yahoo.com
Mon Aug 23 07:53:10 EDT 2004


I've found this in my IRC logs

<Austin__>      I had to tweak some of Batsman's Tar code.
<Austin__>      his tar header was writing the wrong data -- it won't
be compatible with most tar programs out there.
<chad>  I'm seeing some problems in the tar code, too.  header-related?
[NOTE: I'd like to know a bit more about them :-)]
<Austin__>      chad: probably. he was space-padding instead of null-padding.
<Austin__>      regardless, i think that I've got something that could
be extended with ease to do all tar related work :)

Could you specify which field(s) of the tar header is(are) being set
I have reviewed the code and 
* all the fields which need a delimiter but 'checksum' (read on) are null-padded
* the numeric fields in octal are expanded with 0s as needed

My implementation is based on the description available at

In the case of the checksum field, I couldn't find an explicit explanation
under the "POSIX Standard Archives" section, so I kept the convention
from the traditional Archive Format ("the checksum is terminated by a
null and a space."). I'd expect most tar implementations to treat the
checksum as just an ASCIIZ string, discarding the last character

The corresponding unit tests are available at
20 tests, 453 assertions, 0 failures, 0 errors

I'd be grateful if you could provide a failing test case or tell me why
the current ones are wrong.


Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

More information about the Rubygems-developers mailing list