Anonymous user
File size distribution: Difference between revisions
m
→{{header|REXX}}: added a summary (totals).
m (→{{header|REXX}}: added the REXX computer programming language.) |
m (→{{header|REXX}}: added a summary (totals).) |
||
Line 417:
@.=00 /*stemmed array to hold record counts. */
g=0 /*number of good records found (so far)*/
parse upper var
if pos('/', dat) ==0 | pos(":", tim)==0 then iterate /*validate dat&tim*/
if pos(',', sz) \==0 then sz=space( translate(sz, , ","), 0) /*SZ has commas? */
Line 427:
sz=# * 1024 **pos(sfx,'KMGT')/1 /*compute true val*/
end
if sz==0 then L=0 /*handle special case for an empty file*/
else L=length(sz) /*obtain the length of filesize number.*/
Line 451 ⟶ 452:
end /*k*/
end /*y*/
say
▲ /*stick a fork in it, we're all done. */
'ERASE' dirOut /*perform clean─up (erase a work file).*/
say g ' files detected,' $ " total bytes." /*stick a fork in it, we're all done. */</lang>
{{out|output|text= when using the default input: (which in this case was the '''C:''' drive.)}}
<pre>
Line 468 ⟶ 470:
10^8 ──► 10^9 -1 3 ─
10^9 ──► 10^10 -1 1 ─
55537 files detected, 12656297888 total bytes.
</pre>
|