Getting an evaluator error with this Drive Total Size column for This PC
. Seems to happen when format lock is on and another folder is navigated to.
(The columns that were locked in another folder do not show in This PC
when navigated to, which is good, but when navigating away from This PC
the columns from This PC
are retained in the new folder - bug ?)
<?xml version="1.0"?>
<evalcolumn align="2" attrrefresh="no" autorefresh="no" customgrouping="no" foldertype="all" header="Drive Size" keyword="DriveTotalSize" maxstars="5" namerefresh="no" nocache="no" reversesort="no" supportmarkup="no" title="Drive Total Size" type="0">// column for total size of drive in TB or GB
tb = (1024 * 1024 * 1024 * 1024) as int64;
gb = (1024 * 1024 * 1024) as int64;
total_free = Val("sh:freespace") as int64;
total_used = Val("sh:usedspace") as int64;
total = (total_free + total_used) as int64;
if ( total > 549755813888)
return (Ceil(total / tb) + 1) as int + " TB";
else
{
size = (Ceil(total / gb) + 1) as int;
if (size <= 1) return "1 GB";
elseif (size <= 2) return "2 GB";
elseif (size <= 4) return "4 GB";
elseif (size <= 8) return "8 GB";
elseif (size <= 16) return "16 GB";
elseif (size <= 32) return "32 GB";
elseif (size <= 64) return "64 GB";
elseif (size <= 128) return "128 GB";
elseif (size <= 256) return "256 GB";
else return "512 GB";
}
</evalcolumn>
sh:freespace
has been copied from
Keywords for Columns [Directory Opus Manual]