Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Rename-a-file/NetRexx/rename-a-file.netrexx
Normal file
36
Task/Rename-a-file/NetRexx/rename-a-file.netrexx
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols binary
|
||||
|
||||
runSample(arg)
|
||||
return
|
||||
|
||||
-- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
method isFileRenamed(oldFile, newFile) public static returns boolean
|
||||
fo = File(oldFile)
|
||||
fn = File(newFile)
|
||||
fRenamed = fo.renameTo(fn)
|
||||
return fRenamed
|
||||
|
||||
-- 09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)09:11, 27 August 2022 (UTC)~~
|
||||
method runSample(arg) private static
|
||||
parse arg files
|
||||
if files = '' then files = 'input.txt output.txt F docs mydocs D /input.txt /output.txt F /docs /mydocs D'
|
||||
loop while files.length > 0
|
||||
parse files of nf 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 isFileRenamed(of, nf) then dl = 'renamed'
|
||||
else dl = 'not renamed'
|
||||
say ft ''''of'''' dl 'to' nf
|
||||
end
|
||||
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue