Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can you use 7zip to extract a collection of .rar files which if extracted normally would surpass the size of your HDD?

Say your HDD was 10GB, if you had a zip archive of 5GB, how could you extract the contents of the archive without going over the 10GB limit? Can you configure 7zip to delete each part upon extraction of its contents?

share|improve this question
    
no you can't. enough said. –  Sickest Jan 20 at 7:39
    
@Sickest In the extraction process, isn't each archive component (archiveX.rar) extracted serially, meaning it can be deleted following extraction? –  James Jan 20 at 7:45
    
Do you see an option in 7zip that does this? 2ndly have you tried to just do this? Delete 1 file out of the rar while its extracting, please report back what happens. –  Sickest Jan 20 at 7:47
    
i'm 99.9% sure you can't, but i don't see why you cant just look for the option yourself, or test your theory that you can delete a .rar file while its extracting. what could go wrong? –  Sickest Jan 20 at 7:50
    
I have tried to find a switch which does do this but haven't found one. I'll have a go at deleting after extracting. –  James Jan 20 at 7:55

2 Answers 2

up vote 0 down vote accepted

If each of the elements of the archive is smaller than the free space, one could extract the each file indivdually, process them and then remove them. Something like this:

foo.7z contains 10 files of arbitrary size. List, extract, delete:

$ 7za l ../foo.7z
   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2014-01-20 02:11:01 ....A        16885       189065  file.0
2014-01-20 02:11:01 ....A        40122               file.1
[...]

$ 7za l ../foo.7z | awk '/^2014/ {print $NF}' | while read a; do
    7za x ../foo.7z $a > /dev/null
    do-something-with $a
    rm -f $a
done

If there's only one big file in the archive, one could try to extract to stdout and then play games with dd:

 7za a archive.7z one-big-file
 7za x -so archive.7z 2>/dev/null | dd bs=1M count=100 2>/dev/null > part.1
 7za x -so archive.7z 2>/dev/null | dd bs=1M count=100 skip=100 2>/dev/null > part.2
 7za x -so archive.7z 2>/dev/null | dd bs=1M count=100 skip=200 2>/dev/null > part.3
 [...]

...and so on, until dd can't skip no more (and part.N will be empty).

share|improve this answer

The most sensible way is to buy /borrow another Hard drive (internal or external). Then, you can extract all and do what ever you need to (such as delete the original zip).

Alternatively, you can do this manually, in 7-ZIP there is the option to delete. So, you could open 7-ZIP, drag file(s) to the local computer and then delete it from the original compressed archive.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.