Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^6: help with unraring

by gautamparimoo (Beadle)
on Apr 25, 2012 at 08:44 UTC ( #967023=note: print w/replies, xml ) Need Help??

in reply to Re^5: help with unraring
in thread help with unraring

My code is same as i have shown earlier

use Archive::Unrar qw(list_files_in_archive %donotprocess process_file +); use IO::CaptureOutput qw(capture); my @files; { local ($stdout, $stderr); capture sub {list_files_in_archive( file=>"C:/perl2exe/For perl 5.10. +1/test.rar" ,undef)}, \$stdout, \$stderr; @files=map {/Archive contents : (.*)/ } split ("\n",$stdout); } foreach (@files) { print "file ",++$i," : ",$_,"\n"; } ($result,$directory) = process_file( file=>'C:/perl2exe/For perl 5.10.1/test.ra +r', password=>undef, output_dir_path=>"C:/extract/", ); } print "$result"; print "$directory";

$result gives me the chain error

Replies are listed 'Best First'.
Re^7: help with unraring
by nikosv (Chaplain) on Apr 25, 2012 at 09:20 UTC
    paths in windows uses backlashes

    file=>"C:\\perl2exe\\For perl 5.10.1\\test.rar",

    ($result,$directory) = process_file( file=>"C:\\perl2exe\\For perl 5.10.1\\test.rar", password=>undef, output_dir_path=>"C:\\extract" );
    try and tell me
      paths in windows uses backlashes

      Only some tools (including cmd.exe and are restricted to backslashes, the API functions accept both forward slashes and backslashes in all versions of DOS and Windows. So, using forward slashes is perfectly ok.


      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        not in this case.use the aforementioned code, change the slashes,and see what happens

      I changed backslashes but still gives me chain error. Another thing i noticed is that if i comment out list_archives_in_file method , it extracts to the location but if i list_archive first and then process_file it gives the chain error.

        does it extract the files? if yes,forget about the "error" as I have already explained

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967023]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2018-05-27 04:31 GMT
Find Nodes?
    Voting Booth?