File size distribution: Difference between revisions
Content added Content deleted
(→{{header|REXX}}: added support for an alternative comma, added a programming note (before the output section).) |
m (→{{header|REXX}}: added/changed some comments, added boilerplate to suppress some superfluous errors.) |
||
Line 422: | Line 422: | ||
sw=linesize() - 1; if sw<80 then sw=79 /* " terminal width (linesize) - 1.*/ |
sw=linesize() - 1; if sw<80 then sw=79 /* " terminal width (linesize) - 1.*/ |
||
dirOut= fn".OUT" /*construct filename for output of DIR.*/ |
dirOut= fn".OUT" /*construct filename for output of DIR.*/ |
||
'DIR' ds '/s /a-d >' |
'DIR' ds '/s /a-d >' dirOut /*do (DOS) DIR cmd for a data structure*/ |
||
call linein 0, 1 /*open output file, point to 1st record*/ |
call linein 0, 1 /*open output file, point to 1st record*/ |
||
maxL=0 /*maximum length of number of records. */ |
maxL=0 /*maximum length of number of records. */ |
||
Line 442: | Line 442: | ||
maxL=max(L, maxL) /*obtain the maximum length of filesize*/ |
maxL=max(L, maxL) /*obtain the maximum length of filesize*/ |
||
@.L=@.L + 1 /*bump counter of category of rec size.*/ |
@.L=@.L + 1 /*bump counter of category of rec size.*/ |
||
end /*j*/ /* [↑] categories: split by log ten.*/ |
|||
end /*j*/ |
|||
if g==0 then do; say 'file not found: ' ds; exit 13; end |
if g==0 then do; say 'file not found: ' ds; exit 13; end |
||
Line 462: | Line 462: | ||
end /*y*/ |
end /*y*/ |
||
say |
say |
||
'ERASE' dirOut |
trace off; 'ERASE' dirOut /*perform clean─up (erase a work file).*/ |
||
say commas(g) ' files detected,' commas($) " total bytes." |
say commas(g) ' files detected,' commas($) " total bytes." |
||
exit /*stick a fork in it, we're all done. */ |
exit /*stick a fork in it, we're all done. */ |