ZipPop: a space conserving unzipping script
11 points by th0ma5
11 points by th0ma5
I've wanted this multiple times. Not too hard to write but annoying enough never to justify the use of my time. Very good!
Good idea! This is a tool that is definitely necessary. I've run into this issue a fair few times and it just always struck me as "there has to be a better way to do this".
This is way slower as we're (currently) constantly rewriting the index so that you constantly have a valid zip file most of the time.
"constantly most of the time", lol. But also... why? I feel like just copying the header away elsewhere would be a better solution. You could have a separate utility that stitches it back on.
If you're fine with a non-portable solution (you tagged this with linux so I guess you are), I think sparse files would be decent here. See fallocate(2).
Yes yes! I looked into sparse files and found how like exfat doesn't support it but it would be a great idea for NTFS and probably quicker.
One thing ya know I wound up doing because this was so slow was accidentally hitting ctrl+c in the window, and that way I always had a valid zip. I think you're absolutely right though, just make it a separate file you could swap in and out as needed, the doubling of the meta data certainly allows that. That's a good simple enough idea. Please don't use this code to do it hahaha or well. I dunno... I really didn't even attempt cleaning it up. Hmmm... So long as you made sure to keep the local headers you could just have a utility that synthesizes a whole new header I wonder if zipfix works like that. Thank you for checking this out and for the feedback!
Edited to say ... Yes yes ext4 supports that ... I was on exfat here but yes that makes a lot of sense, get the free space, extract any file you need without juggling.