Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: help with unraring

by gautamparimoo (Beadle)
on Apr 24, 2012 at 06:14 UTC ( #966739=note: print w/ replies, xml ) Need Help??


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

I want to do it programatically because i need it in a large script


Comment on Re^2: help with unraring
Re^3: help with unraring
by ww (Bishop) on Apr 24, 2012 at 11:58 UTC
    That's not a relevant response to Argel's suggestion; or, it's not relevant based on anything you've told us about your requirements.

    Sure, you'll find many nodes here with which urge use of Perl's own capabilities or modules to achieve a goal, but that's NOT the same as deprecating use of an outside capability... nor somehow is it somehow 'non-"programatically".'

    edit: s/with/which/

      I want to extract one file perform some operation and then extract the next which is not possible by 7zip as it would extract the full content of rar file in one go

        Unless there is some dependancy you haven't disclosed -- say, for example, that the content of the file currently being processed determines which file to extract and process next -- your desire to extract them one at a time is not a war-stopper; it is merely one alternative approach:
        Pseudocode: un7zip ($archive); @todo = readdir (extracted files); for $todo(@todo) { process as you wish... }
        Most decompression/compression programs support extracting/adding individual files from/to an archive. This should work, but I only tested it against a .7z file. But I am not aware of any reason why it would not work with .rar files.
        7z.exe e <archive_name.rar> <path_to_file_in_archive>
        Here's an example. Given a 7-zip file called test.7z, containing:
        test test/foo test/bar
        This should extract just 'bar' to your current working directory:
        7z.exe e test.7z test/bar

        Elda Taluta; Sarks Sark; Ark Arks
        My deviantART gallery

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://966739]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2014-08-22 13:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (157 votes), past polls