Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Delete archive after extraction

Feroc
2010-07-05
2013-06-03
  • Feroc
    Feroc
    2010-07-05

    Hey,

    I really wish I could finally remove WinRAR from my machine, but it has one very important feature for me: It can delete the archive after successful extraction. I often have to extract a lot of archives (some multifile-archives, some single file archives, some rar, some zip, etc.).

    In WinRAR it is very easy, I just mark all file and let them extract in a different folder, WinRAR deletes everything that got successfully extracted and only leaves the archives, which weren't extracted. So I can easilie identify defect archives, have all my files extracted and the directory is cleaned up.

    Please please  please add a "Delete after extraction" option!

     
  • Vacon
    Vacon
    2010-07-05

    Hello everyone,

    yes, I read the word "option" you wrote above. But from my point of view it's kind of dangerous to have this. Imagine you have a backup of some files (documents or pictures for instance) and unpack them with the mentioned option activated -> backup = gone. If you notice that *before* you modify your data, well, you can backup again. If you notice this *after* modification -> backup = gone…
    Deleting data is usually a task users should do by themselves. Options are sometimes seducing…

    Best regards!

     
  • Yes, by all means don't allow people to make their own decisions. It's no less dangerous to manually delete files than letting it be done automatically by the program so you don't have to sort through a cluttered folder of 7z or rar files. Have you ever heard of something called "restore" in the recycle bin? You insult our intelligence.

     
  • Vacon
    Vacon
    2010-07-08

    Hello everyone,

    :-)
    Recycle-bin… You are talking about *that* recycle-bin that eats 5 to 10% of your HDD to save you some space when you "delete" something…? And that is *never*ever* made empty? And programs like ReCuva, TestDisk/PhotoRec are made because users simply can look into RecycleBin?
    Sorry if I insulted your intelligence :-)

    Best regards!

     
  • Vacon
    Vacon
    2010-07-08

    Hello everyone,

    oh, I nearly missed one point:
    files that have been on an USB-stick and have been uncompressed from there are deleted too. Most probably *not* to recycle-bin…
    Same is true for network-drives, iirc.

    Best regards!

     

  • Anonymous
    2010-07-19

    Note that this is the default behavior in Mac OS X, so there are literally millions of people who routinely interact this way with archives. Safari even extracts and thrashes every zip it downloads, without even a prompt. This by itself isn't proof of anything, but it does go to show that this isn't all that crazy of an idea. Reasonable people have looked at the question and found that the benefit in user experience is worth the trade-off in risk of data loss.

    In any case, I suggest a happy medium: add an optional context-menu entries for "Extract and Trash Archive". That way you know that the user has explicitly requested the deletion.

     
  • rororo299
    rororo299
    2010-07-23

    But 7zip sets errorlevel upon an error. So you could write a batch file:

    c:\Programme\7-Zip\7z x %1
    if errorlevel 1 goto :error
    del %1
    :error

    Or use a more sophisticated script language like Perl, Ruby, Python, etc.

     

  • Anonymous
    2010-12-04

    I need delete after extraction too!   I get a lot of archives from newsgroups, especially ones in like 100 parts. lol  So being able to automatically delete after successful extraction like WinRAR can is a big plus (and why I have to keep WinRAR installed too).

    Then again 7zip is free so don't expect much. :P

     
  • Roger Moser
    Roger Moser
    2010-12-05

    I have added to the File Manager and to the FAR plugin the feature to delete the files from the disk after successfully moving them to an archive and to delete the files from the archive after successfully extracting them:

    http://pamho.com/7z/7z920rm2bin.7z (735kB, 32-bit executables)
    http://pamho.com/7z/7z920rm2src.7z (110kB, changed source files)

    In the File Manager press Shift while draging the file from or to an archive, or click "Move". And in the FAR Manager press "F6". Moving files from one archive to another archive is not supported. Unlike WinRar, it does not delete the file if the extracting was not successful. I have not programmed that the archive file itself is deleted when it became empty.

     
  • Vacon
    Vacon
    2010-12-05

    Hello everyone,

    if I get you right, your code checks if the extraction was successful and only deletes the files in an archive if everything went right?
    And in case all files inside an archive were extracted an empty archive is kept?

    Best regards!

     
  • Roger Moser
    Roger Moser
    2010-12-05

    If "move files" is selected, my versions deletes those files that have been successfully compressed or extracted. It deletes them also even if some files failed or if you answered "No" to some files. When you move all files from a achive, an empty archive remains, like if you move all files from a folder, an empty folder remains. You can then delete the empty archive by three clicks.

     
  • Vacon
    Vacon
    2010-12-05

    Hello everyone,

    It deletes them also even if some files failed or if you answered "No" to some files.

    yup. That's why I'm no real friend of automated deleting. And to be honest: regarding that feature, I always backed Igor to stand tall.
    And I'm curious how long it will take until people cry because they now have to delete *empty* archives after extraction instead of the original archives (there were people that felt strongly forced to tell us about the fact that they download some films or games spanned over 100 parts and wanted a feature to delete this 100 parts after extraction, because they are to laggard to do this manually…)

    Best regards!

     
  • Roger Moser
    Roger Moser
    2010-12-06

    That's why I'm no real friend of automated deleting.

    Then don't press the Shift key while you are draging the files but always press the Ctrl key. And never click "Move" or press  "F6".

     
  • Arto65
    Arto65
    2011-03-24

    I have been using automatic deletion after successful exctraction since two years, and I can tell you one thing: it's awesome.
    The best extraction utility I use is "The unarchiver", on OS X. It has an option to extract the archive in a folder if there are more than 1 item at root: so it always behave exactly like myself, but it just takes less time! When I have 20 archives in a folder and I don't know what's inside it, it takes me 10 minutes to go through it. What a waste of time !!
    Another software to use that feature is Sabnzbd through winrar.

    There are millions of people using that feature and just loving it.
    I wished there were a program as convenient as The unarchiver on Windows.

     
  • xkiter
    xkiter
    2011-08-10

    Wonderful. Just what I was looking for several years. Only WinRAR had it and is ESSENTIAL for archiving. Is it going to be included in the official mainstream version?

     
  • vp1988
    vp1988
    2011-09-12

    Deletion-after-extraction would be very time-saving feature for me too. For example, WinRAR also providing an option of asking user after extraction whether he want to delete the unpacked archive or not. Very useful for me, can't switch to 7-zip just because of that.

     
  • titus
    titus
    2011-09-19

    I archived a file and selected option to delete, however it's only deleting files not folder. Any help?

     
  • S
    S
    2012-03-31

    They should have it as a flag you can enter in the dos based version, so you have to choose -XD for example (with path and delete)
    Doesn't have to be in the GUI version if they don't want 'dummies' using the feature but I need it.

     
  • fernando
    fernando
    2012-03-31

    @abrasion

    7z e archive.7z && del archive.7z

    …not so difficult…

     
  • S
    S
    2012-03-31

    I assume the && is piping it back to a dos command?  
    That's not ideal, what if the rar file for example is
    HAM.RAR

    7z e HAM.RAR && del HAM.RAR

    I believe HAM.R01 HAM.R02 would be left on the disk then.
    Much better to do it the way WinRAR does it now.

     
  • xxx
    xxx
    2013-06-03

    Is there any way to get "Extract & delete archives" now ?
    Could be very useful