(notonline)-->
without js -- file i/o
sequence sizes = {1},
res = {0}
atom t1 = time()+1
function store_res(string filepath, sequence dir_entry)
if not find('d', dir_entry[D_ATTRIBUTES]) then
atom size = dir_entry[D_SIZE]
integer sdx = 1
while size>sizes[sdx] do
if sdx=length(sizes) then
sizes &= sizes[$]*iff(mod(length(sizes),3)?10:10.24)
res &= 0
end if
sdx += 1
end while
res[sdx] += 1
if time()>t1 then
printf(1,"%,d files found\r",sum(res))
t1 = time()+1
end if
end if
return 0 -- keep going
end function
integer exit_code = walk_dir(".", store_res, true)
printf(1,"%,d files found\n",sum(res))
integer w = max(res)
--include builtins/pfile.e
for i=1 to length(res) do
integer ri = res[i]
string s = file_size_k(sizes[i], 5),
p = repeat('*',floor(60*ri/w))
printf(1,"files < %s: %s%,d\n",{s,p,ri})
end for