It looks like a reasonable implementation. Have you tried decompressing the TGZ with a known good tool (i.e. tar -xzf) and seeing if that works OK?
Adam Wright
2009-10-19 14:39:53
It looks like a reasonable implementation. Have you tried decompressing the TGZ with a known good tool (i.e. tar -xzf) and seeing if that works OK?
Based on the code you posted it looks like your trying to read a Tar'ed gZip'ed file using gzip only.
My guess is that the "junk" at the start of the file after decompression is infact the TAR file header (I see a file name there right at the start).
More hints at Tar File Format point to the 512 byte size.
gzip can only compress a single file. If you are only trying to compress a single file you don't need to tar it first.
If you are trying to compress multiple files and as a single archive then you would need to use TAR and untar the files after you decompressed them.
Just a guess.
chris.