RosettaCodeData/Task/File-size/REXX/file-size-2.rexx
2015-11-18 06:14:39 +00:00

16 lines
444 B
Rexx

/*REXX pgm to verify a file's size */
parse arg iFID . /*let user specify the file ID. */
if iFID=='' then iFID="FILESIZ.DAT" /*Not specified? Then use default*/
say 'size of' iFID':'
Say chars(ifid) '(CR LF included)'
Call lineout ifid /* close the file */
say filesize(ifid) '(net data)'
Call lineout ifid
exit
filesize: parse arg f;
sz=0;
Do while lines(f)\==0
sz=sz+length(linein(f))
End
return sz