852
@verb #3852:"_audit" this none this rxdo #3852
@program #3852:"_audit" this none this
"Copied from Quadir (#9780):_audit Aug 13 08:22:10 2000"
"Taken and modified for ANSI from #12:_audit"
caller == this || raise(E_PERM)
set_task_perms(caller_perms())
lines = sizes = {}
toasty = 0
nbytes = nobjs = ndisk = 0
for x in (args)
if (!$recycler:valid(x))
continue
endif
size = `x:object_bytes() ! E_PERM => "UnReadable"'
dsize = x:_obj_disk_size()
if (`x:_get_subsidised() ! E_PROPNF => 0')
dsizestr = "[subsidised]"
else
dsizestr = dsize || ""
endif
sizestr = size || ""
if (`x:_get_petrified() ! E_PROPNF => 1')
expire = "[petrified]"
elseif (x:_get_solidified())
expire = "[solidified]"
elseif ($object_utils:isa(x, $player))
expire = ""
elseif (x:is_expired())
expire = "*EXPIRED*"
toasty = toasty + 1
else
expire = $string_utils:from_seconds(x.best_before - time())
endif
lines[1..0] = {{tostr(x), `x:title() ! ANY => "???"', ``$find_reference_in_ancestry(x) ! ANY => x:audit_name()' ! ANY => "???"', tostr(sizestr), tostr(dsizestr), expire}}
sizes[1..0] = {size}
if (!(`x:_get_petrified() ! E_PROPNF' || `x:_get_subsidised() ! E_PROPNF'))
nobjs = nobjs + 1
nbytes = nbytes + (typeof(size) == $INT ? size | 0)
ndisk = ndisk + dsize
endif
$command_utils:suspend_if_needed()
endfor
$tcm || (lines = $list_utils:sort(lines, sizes))
lines = {@lines, "-"}
lines = {@lines, {"", "Total quota used:", tostr(nobjs), tostr(nbytes), tostr(ndisk), ""}}
lines = {@lines, {"", "Free quota:", tostr(dobj:free_objects()), tostr(dobj:free_bytes()), tostr(dobj:free_dbytes()), ""}}
this:tellColumns(3, {20, 10, 15, 20, 20, 20}, {"#", "name", "type", "bytes", "dsize", "good for"}, @lines)
if (toasty)
this:sub_tell("Total %2 expired objects... %1's coming...", $repo_man, toasty)
endif
"Last modified by Dax (#789) on Tue May 3 13:51:16 2005 MDT."
.
0