Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
34
Task/File-size/NetRexx/file-size.netrexx
Normal file
34
Task/File-size/NetRexx/file-size.netrexx
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java symbols binary
|
||||
|
||||
runSample(arg)
|
||||
return
|
||||
|
||||
-- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
method fileSize(fn) public static returns double
|
||||
ff = File(fn)
|
||||
fSize = ff.length()
|
||||
return fSize
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
method runSample(arg) private static
|
||||
parse arg files
|
||||
if files = '' then files = 'input.txt F docs D /input.txt F /docs D'
|
||||
loop while files.length > 0
|
||||
parse files fn ft files
|
||||
select case(ft.upper())
|
||||
when 'F' then do
|
||||
ft = 'File'
|
||||
end
|
||||
when 'D' then do
|
||||
ft = 'Directory'
|
||||
end
|
||||
otherwise do
|
||||
ft = 'File'
|
||||
end
|
||||
end
|
||||
sz = fileSize(fn)
|
||||
say ft ''''fn'''' sz 'bytes.'
|
||||
end
|
||||
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue