View Single Post
Old 04-10-2006, 06:29 PM   #3 (permalink)
cyrnel
Adequate
 
cyrnel's Avatar
 
Location: In my angry-dome.
A few zippers have scripting methods included. I don't know them so resort to ugliness.

Copy to compressbigstuff.bat:
Code:
@echo off
for %%i in (*.txt) do if %%~zi GTR 250000000 7za a dummy -tgzip -so %%i > %%~ni%%~xi.gz && 7za t %%~ni%%~xi.gz && if %ERRORLEVEL% EQU 0 erase %%i
Scary but functional. It only compresses 250MB txt files as is. Assumes 7za (http://www.7-zip.org/) is in your path. (BTW, 7zip is very efficient compared to rar, winzip, etc.)

Change the "(*.txt)" to "*" for everything, or allow passing in your own directory with %1, etc. You could have it follow directories by changing "for" to "for /R", but I wasn't that adventurous. (see "for /?" from the command line)

7zip can be multithreaded if you ask it to be with some compression types. I wouldn't bother forcing multiple instances or it'll be slower from overhead and thrashing, and force file fragmentation.
__________________
There are a vast number of people who are uninformed and heavily propagandized, but fundamentally decent. The propaganda that inundates them is effective when unchallenged, but much of it goes only skin deep. If they can be brought to raise questions and apply their decent instincts and basic intelligence, many people quickly escape the confines of the doctrinal system and are willing to do something to help others who are really suffering and oppressed." -Manufacturing Consent: Noam Chomsky and the Media, p. 195
cyrnel is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40