Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- reading a zip from an IO::Scalar in 5.8
October 14, 2004, 2:54 am
rate this thread
How do I need to change the code given in the Archive::Zip examples
directory to make it work with perl 5.8? It works ok on machines with
5.6 and I'm assuming that it's a problem caused by changes in 5.8.
When I try to run the readScalar.pl code I get:
Read 20000 bytes
error: file not seekable
called at ./readScalar.pl line 20
(this is the code):
# Demonstrates reading a zip from an IO::Scalar
# $Revision: 1.4 $
use Archive::Zip qw(:CONSTANTS :ERROR_CODES);
# test reading from a scalar
my $file = IO::File->new('testin.zip', 'r');
printf "Read %d bytes\n", length($zipContents);
my $SH = IO::Scalar->new($zipContents);
my $zip = Archive::Zip->new();
$zip->readFromFileHandle( $SH );
my $member = $zip->addString('c' x 300, 'bunchOfCs.txt');
$member = $zip->addString('d' x 300, 'bunchOfDs.txt');
Re: reading a zip from an IO::Scalar in 5.8
Second attempt at posting - apologies if the first attempt shows up as
well. (Never use Mozilla .... for *anything* !!!)
I find no problem with the script on both perl 5.6.1 and perl 5.8.5 so
long as "testin.zip" is no larger than the number of bytes being read
(20,000 in the example given).
I'm on Windows2000.
To reply by email u have to take out the u in kalinaubears.