This is a sample from a tar file class I created for a chef cookbook. In this example I'm iterating over entries in the tar file. Because of the way tar handles filenames over 100 chars (././@LongLink) I have to do something to register that i'm dealing a longlink and treat the next entry differently.
I would love any advice on how to clean this up. Its a super long method, I especially don't like that I have to set full_name
to nil and twice.
Is there something about variable scope that prevents this?
Also, it having call the
gzip_reader()
call seems inconsistent with the method name.Got any test cases so I can play with this more?
oh, and if @mattupstate's code works, and
longlink(fn)
returned false ifflonglink?(fn)
, you could be a bit more brief by usinginstead of