Archive::Tar

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Michael Ellery [ Do, 03 September 2009 00:21 ] [ ID #2014560 ]

Re: Archive::Tar

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Serguei Trouchelle [ Do, 03 September 2009 00:27 ] [ ID #2014561 ]

Re: Archive::Tar

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Michael Ellery [ Do, 03 September 2009 00:50 ] [ ID #2014562 ]

Re: Archive::Tar

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 [at] listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lyle [ Do, 03 September 2009 01:03 ] [ ID #2014563 ]

Re: Archive::Tar

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 [at] list = $tar->extract();
foreach ( [at] list) {
printf "%s\n", $_->{name};
}

__END__
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Bill Luebkert [ Do, 03 September 2009 01:07 ] [ ID #2014564 ]

Re: Archive::Tar

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Serguei Trouchelle [ Do, 03 September 2009 01:09 ] [ ID #2014565 ]

Re: Archive::Tar

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Michael Ellery [ Do, 03 September 2009 01:13 ] [ ID #2014566 ]
Perl » gmane.comp.lang.perl.active-perl » Archive::Tar

Vorheriges Thema: Tkx::tktable
Nächstes Thema: FW: Scrollbar on main window