Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
User Journal

Journal drinkypoo's Journal: Extracting to temp and copying? 10

Not submitting this one to the queue or anything, but why in hell is it that practically every archiver on Windows extracts to the temp folder and then copies the file to the target destination? This approach makes certain archives unusable. For example, let's say you have an archive with two archives inside it and need to extract a file from one of them; you have enough room for the archive, one of the archives inside the archive, and one file inside THAT, but you can't get it out because when the file is extracted, the copy fails, and then the original is deleted. 7-Zip is the program I most recently noticed this behavior in. Is it just an attempt to keep the user from screwing with the open file that the archiver is writing to? And if so, doesn't there have to be a far more intelligent way to handle this problem? If nothing else it would lead to unnecessary filesystem fragmentation.
This discussion has been archived. No new comments can be posted.

Extracting to temp and copying?

Comments Filter:
  • I really wish I could find a way to prevent it. I've tried.
  • I seem to remember all the archivers I used moving from the temp. This still poses the problem you noted if your %temp% folder exists on the different partition than your destination, but if they're the same partition and you're using NTFS, the move operation is just a matter of updating the FAT, no data is actually transfered.

    Also, I know WinRAR has the option to set the path used for the temp folder and IIRC only uses that folder for removable drives, normally it DOES extract directly to the destination.

    K
    • if they're the same partition and you're using NTFS, the move operation is just a matter of updating the FAT, no data is actually transfered.

      Yes, but it's not a move, it's an explicit copy. My temp and the destination were on the same volume, I extracted a 650MB and a 400MB archive from an archive with 7-Zip, and it was not a move but a copy. Had to sit there and wait for it.

      Other programs do explicit copies as well.

      I want to know why.

      • by BobPaul ( 710574 ) *
        Hmm.. I wonder if it depends on the archive type. I dug out a copy of Windows an setup a VM just for you!

        I tried 7zip to extract a 200MB file from a RAR archive on a Samba share. The file was created on the destination immediately, without use of %temp%. The name of the 7Zip dialog was "Copying xx%" but it was clearly extracting and the destination file was growing.

        When I put the RAR inside a local 7z archive using no compression, I had the same results extracting the RAR and then the file.

        Only if I double
        • I used 7-Zip 4.45 beta (newer than your 4.42) and extracted the large files (two files totaling about 1.2GB) from a ZIP archive.
          • by BobPaul ( 710574 ) *
            Bingo. 7Zip will extract to temp and copy if you use drag and drop. If you press the extract button or use the extract options in the context menu it extracts directly to the destination. WinRAR uses a move and only uses the temp if removable media is involved.

            Playing with it further, it seems the size and type of archive and files are not taken into account, this happens on every drag and drop extraction. I guess I was bushing the buttons earlier.

            The only reason I can think of for this is in cases where th
            • I used the webform on the 7-Zip website to send a message. I'll try to remember to post here when/if I get a reply.
              • by BobPaul ( 710574 ) *
                There are a couple of feature requests asking for move or no use of temp at all, but they're both really old and unassigned.
  • I haven't had problems with archivers copying to temp directories in a long time, but I can understand that those with slower PCs might still suffer over issues like this. My uneducated guess is that the archiver is copying it to the temp directory because if the extraction operation fails nothing is left "half done". By that I mean that if the archiver crashes in the middle of extraction it doesn't leave half an uncompressed file in the destination directory. Or, worse, if you are overwriting a file in
    • I haven't had problems with archivers copying to temp directories in a long time, but I can understand that those with slower PCs might still suffer over issues like this.

      If I'm extracting a couple of files around 500MB (or larger) from an archive on Windows XP on a typical (7200 rpm) hard disk, then I will have to wait approximately six to ten minutes just for those file copies, during which the system is less responsive because of NT's crap scheduler.

      My uneducated guess is that the archiver is copying i

I've noticed several design suggestions in your code.

Working...