Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
35
Task/Delete-a-file/NetRexx/delete-a-file.netrexx
Normal file
35
Task/Delete-a-file/NetRexx/delete-a-file.netrexx
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols binary
|
||||
|
||||
runSample(arg)
|
||||
return
|
||||
|
||||
-- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
method isFileDeleted(fn) public static returns boolean
|
||||
ff = File(fn)
|
||||
fDeleted = ff.delete()
|
||||
return fDeleted
|
||||
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
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
|
||||
if isFileDeleted(fn) then dl = 'deleted'
|
||||
else dl = 'not deleted'
|
||||
say ft ''''fn'''' dl
|
||||
end
|
||||
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue