Archive::Tar

Archive::Tar

am 03.09.2009 00:21:45 von Michael Ellery

Has anyone had success using this module with activeperl on windows XP?
I've tried to run this simple script:

my $tar = Archive::Tar->new("c:/myfile.tgz");
$tar->extract();

...and it just seems to consume 100% of the CPU and never complete. I
also tried a plain tar file (not gzipped) and had similar results.

Any experience out there with this?

Thanks,
Mike Ellery
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Archive::Tar

am 03.09.2009 00:27:28 von Serguei Trouchelle

Michael Ellery wrote:

> Has anyone had success using this module with activeperl on windows XP?
> I've tried to run this simple script:
>
> my $tar = Archive::Tar->new("c:/myfile.tgz");
> $tar->extract();

Try this:

my $arc = Archive::Tar->new('c:/myfile.tgz', 1);
$arc->extract($arc->list_files());

It works for me just fine with most of CPAN tar.gz distributions.

--
Serguei Trouchelle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Archive::Tar

am 03.09.2009 00:50:01 von Michael Ellery

Serguei Trouchelle wrote:
> Michael Ellery wrote:
>
>> Has anyone had success using this module with activeperl on windows XP?
>> I've tried to run this simple script:
>>
>> my $tar = Archive::Tar->new("c:/myfile.tgz");
>> $tar->extract();
>
> Try this:
>
> my $arc = Archive::Tar->new('c:/myfile.tgz', 1);
> $arc->extract($arc->list_files());
>
> It works for me just fine with most of CPAN tar.gz distributions.
>

hmmm - I tried this and get the same results (so far I've let it run for
20 minutes max). I wonder if this archive is simply too big for this
library to handle (it's about 40 mb, which doesn't seem particularly
large to me, but who knows...)

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Archive::Tar

am 03.09.2009 01:03:11 von lyle

I recently patched Tar.pm ( a different one ) to work on windows:-
http://search.cpan.org/~cdybed/Tar-0.04/Tar.pm

I chose it because it has no deps. I haven't submitted my patches to the
author as that module is 12 years old. But if you want I can email it to
you.

Lyle

Michael Ellery wrote:
> Serguei Trouchelle wrote:
>
>> Michael Ellery wrote:
>>
>>
>>> Has anyone had success using this module with activeperl on windows XP?
>>> I've tried to run this simple script:
>>>
>>> my $tar = Archive::Tar->new("c:/myfile.tgz");
>>> $tar->extract();
>>>
>> Try this:
>>
>> my $arc = Archive::Tar->new('c:/myfile.tgz', 1);
>> $arc->extract($arc->list_files());
>>
>> It works for me just fine with most of CPAN tar.gz distributions.
>>
>>
>
> hmmm - I tried this and get the same results (so far I've let it run for
> 20 minutes max). I wonder if this archive is simply too big for this
> library to handle (it's about 40 mb, which doesn't seem particularly
> large to me, but who knows...)
>
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Archive::Tar

am 03.09.2009 01:07:06 von Bill Luebkert

Michael Ellery wrote:
>
> hmmm - I tried this and get the same results (so far I've let it run for
> 20 minutes max). I wonder if this archive is simply too big for this
> library to handle (it's about 40 mb, which doesn't seem particularly
> large to me, but who knows...)

This works fine for me (version 1.38 of Tar on perl 5.8.8):

use strict;
use warnings;
use Archive::Tar;

my $tar = Archive::Tar->new('E:/tmp/somefile.tgz');
my @list = $tar->extract();
foreach (@list) {
printf "%s\n", $_->{name};
}

__END__
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Archive::Tar

am 03.09.2009 01:09:46 von Serguei Trouchelle

Michael Ellery wrote:

>> my $arc = Archive::Tar->new('c:/myfile.tgz', 1);
>> $arc->extract($arc->list_files());
>>
>> It works for me just fine with most of CPAN tar.gz distributions.

> hmmm - I tried this and get the same results (so far I've let it run for
> 20 minutes max). I wonder if this archive is simply too big for this
> library to handle (it's about 40 mb, which doesn't seem particularly
> large to me, but who knows...)

Actually, yes. It is PP and it stores file contents in memory.
Even 1MB can too big for Archive-Tar's extract if there's a lot of files in it.

You may want to try extract_file method, it should be faster, or even tar.exe from MinGW or UnxUtils.

--
Serguei Trouchelle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Archive::Tar

am 03.09.2009 01:13:46 von Michael Ellery

Serguei Trouchelle wrote:
> Michael Ellery wrote:
>
>>> my $arc = Archive::Tar->new('c:/myfile.tgz', 1);
>>> $arc->extract($arc->list_files());
>>>
>>> It works for me just fine with most of CPAN tar.gz distributions.
>
>> hmmm - I tried this and get the same results (so far I've let it run for
>> 20 minutes max). I wonder if this archive is simply too big for this
>> library to handle (it's about 40 mb, which doesn't seem particularly
>> large to me, but who knows...)
>
> Actually, yes. It is PP and it stores file contents in memory.
> Even 1MB can too big for Archive-Tar's extract if there's a lot of files
> in it.
>
> You may want to try extract_file method, it should be faster, or even
> tar.exe from MinGW or UnxUtils.
>

okay - thanks for the advice. My archive actually contains a single
large file (exe image), so I might still have problems with
extract_file. My current fall-back plan is to use 7-zip to extract in a
shell command, which seems to work fine.



_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs