Gossamer Forum
Home : General : Perl Programming :

Anyone know any good toupee retailers?

Quote Reply
Anyone know any good toupee retailers?
...because I've just ripped all my hair out.

I wrote my own tar module and it was working perfectly...I went to bed, woke up and now it doesn't work.

Basically when reading the tar it tells me there was a checksum error and then a read error. It will create a new tar and I can open it fine with winrar/winzip so that leads me to believe it isn't corrupt however when trying to read the tar into memory I get the read error.

So either the code is writing a corrupt tar (not sure that is happening) or it isn't reading them properly.

I don't understand why it was working and then suddenly stopped which is probably yanking my chain more so than the error.

I didn't really want to post the code...but hey, needs must.

Any thoughts would be appreciated...it's pretty complexed stuff so peek if you dare.

(I though it would be good to post here though as I always find the error minutes after posting Laugh)

It is barfing here in read_tar:

Code:
# End of archive.
return if $head eq "\0" x 512;

substr($head,148,8) = " ";
unpack("%16C*",$head) != $chksum and warn sprintf($ERRORS->{CHECKSUM}, $name);

# Compressed.
if ($comp) { $compr->gzread($data, $size) }

# Not compressed.
else {
if (CORE::read (TAR, $data, $size) != $size) {
$WO::Tar::error = sprintf($ERRORS->{READERROR}, $file);
return;
}

}

I'm probably asking too much really but hopefully a staff member will pass by.

Last edited by:

Paul: Jul 14, 2002, 9:26 AM
Quote Reply
Re: [Paul] Anyone know any good toupee retailers? In reply to
Wooooo my theory paid off....I found the error :) (plus another little bug)...yay!
Quote Reply
Re: [Paul] Anyone know any good toupee retailers? In reply to
I guess you better cancel that toupee order!Smile


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Anyone know any good toupee retailers? In reply to
>>I guess you better cancel that toupee order!<<

My hair is gone though Blush
Quote Reply
Re: [Paul] Anyone know any good toupee retailers? In reply to
So is mine... better make the order for two!


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Paul] Anyone know any good toupee retailers? In reply to
Hi,

I hope you didn't base your code off Archive::Tar? We started doing that, but found it would create corrupted tar files. We ended up having to do a byte by byte comparision from what /bin/tar would create. The pack string we ended up with was significantly different then what Archive::Tar had (archive::tar would create and open files ok, but you couldn't use /bin/tar to open something archive::Tar had created, it would complain about corrupt tar).

If you need it to work with /bin/tar, you may want to look at our pack string we ended up with (make sure you look at version 1.45 or later).

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Anyone know any good toupee retailers? In reply to
I just created a tar using my module and uploaded in to my server....it extracted without any errors....it will also open with winrar/winzip.

Thanks for letting me know though...I'll keep an eye out for anything weird.

The error I encountered above was a lame mistake of closing the file handle too early.

Last edited by:

Paul: Jul 14, 2002, 5:15 PM
Quote Reply
Re: [Paul] Anyone know any good toupee retailers? In reply to
We only got it on ceartain combinations of files/dirs. If you run into a situation where your tar's don't open in /bin/tar or winzip, that's probably it. =)

Cheers,

Alex
--
Gossamer Threads Inc.