On Feb 16, 12:24 pm, "Mumia W." <paduille.4060.mumia.w
+nos...@earthlink.net> wrote:
> On 02/16/2007 08:42 AM, au.da...@gmail.com wrote:
>
> > On Feb 15, 4:29 pm, "mar...@gmail.com" <mar...@gmail.com> wrote:
> >> [...]
> >> From perl you can execute any unix command using system("cmd").
>
> >> Regards,
> >> Manish
>
> > Thanks for all reply, actually, I am running my script in windows XP,
> > so I can not use unix cmd.
>
> You can install the Perl module Archive::Tarto help you with thetarfiles.
>
> --
> Windows Vista and your freedom in conflict:http://www.regdeveloper.co.uk/2006/1...eula_analysis/
Thank for everyone's reply!!
Below is my perl code, which can unzip all .tar file from
one directory, however, since I have around 20 .tar files
in this directory(each one is 100MB), when the script running,
my pc becomes really slow, I guess that because Perl put them
into the memory, could anyone tell me if I can extract these big
..tar files without using large amount of my PC memory? Thanks!
This is my code:
================================================== ===========
opendir(DIR,"$localpath") || die("cannot open $localpath");
foreach $direntry (readdir(DIR))
{
if ($direntry =~ /tar/)
{
print "direntry tar is: $direntry\n";
if ($tar->read("$localpath/$direntry",1))
{
print "read $direntry successfully\n";
}
if ($tar->extract())
{
print "extract $direntry successfully\n";
}
}
}
================================================== ===============
Also I try to put the unziped files into a different folder, but the
$tar->extract_file is not working like below code, what is wrong with
that?
$tar->extract_file("$localpath/1.tar","$localpath/extract/test");
thanks a lot!