FYI, some notes (since I was lazy

)...
1) It's always wise with CCSs to add an early return based on permanent variables so you can easily disable a column without removing it. For instance starting your CCS with something like:
Code: Select all
if ($P_DISABLE_CUSTOM_COLUMNS == true || $P_DISABLE_CC_14 == true) { // (replace 14 with CC's index)
return 'off';
}
//rest of script.
This way you can disable all Custom Columns (which check these vars) by setting
perm $P_DISABLE_CUSTOM_COLUMNS = true; or just a particular column using the
$P_DISABLE_CC_## variable instead. (Feel free to give the latter a more descriptive name instead of tying it to the index.)
2) If possible add some early returns to abort the script if not on a specified drive. Rather than let the script churn away on network or portable devices do some light path checking to only run on certain drives.
Code: Select all
if (<curpath> UnLikeI 'C:\*') {
return 'usd'; //Unsupported drive.
}
Again using permanent variables for the supported drives might be smart.
3) It might be worth checking the zip file's reported size and aborting if it is above some superficial size. You'd probably prefer not knowing the uncompressed size to waiting for it to figure out just how much data is in that 1 GB archive before you can continue browsing.
4) This script is lazy when extracting the sizes. If your archive contains any items whose names look like a size it is going to treat them as sizes even though it shouldn't. A file named '10000000000000 bytes.txt' is going to add an additional 10000000000000 bytes to the total even if the file itself is empty (0 bytes).
Really it all boils down to whittling the total possible execution time of the script down to something that is always acceptable - but you have to leverage that against the increases caused by checking for and avoiding possibly slow conditions.