muba has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use Archive::Tar; my $tar = Archive::Tar->new; #read "package.tar.gz" as a compressed file $tar->read("package.tar.gz", 1); #... $file = "addfile.txt"; #not using die here to prevent the "at pack.pl line x" part open THEFILE, "<$file" or do{print "Could not open $file: $!\n"; exit 1}; #get file contents $data = {local $/ = undef; <THEFILE>}; close THEFILE or do{print "Could not close $file: $!\n"; exit 1}; #create a file in the archive named after the original file, store +d in directory pagepack. #copy the contents of the file to the archived file $tar->add_files("pagepack/$file"); $tar->add_dat("pagepack/$file", $data); #save the file as a compressed archive #This is where the checksum errors seem to appear $tar->write("package.tar.gz", 1);
my $native_language = "Dutch";
my $code = not $tested unless $specified{$otherwise};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: checksum error in Archive::Tar
by tachyon (Chancellor) on Mar 15, 2004 at 20:44 UTC | |
by muba (Priest) on Mar 17, 2004 at 09:54 UTC | |
|
Re: checksum error in Archive::Tar
by Taulmarill (Deacon) on Mar 15, 2004 at 16:07 UTC |