Rename a file: Difference between revisions

Added Quackery.
m (→‎{{header|Processing}}: fix bogus markup)
(Added Quackery.)
Line 1,098:
shutil.move("/docs", "/mydocs")</lang>
 
=={{header|QB64Quackery}}==
<lang qbasic>NAME "input.txt" AS "output.txt"
NAME "\input.txt" AS "\output.txt"
NAME "docs" AS "mydocs"
NAME "\docs" AS "\mydocs"</lang>
 
Quackery does not have a full set of file and directory handling words, so we pass a script string to the host language. A word could be defined in Quackery to construct the appropriate script string; this is the "once-off" version.
=={{header|R}}==
 
<lang R>file.rename("input.txt", "output.txt")
<lang Quackery> $ "
file.rename("/input.txt", "/output.txt")
import os
file.rename("docs", "mydocs")
if os.path.exists('input.txt'):
file.rename("/docs", "/mydocs")</lang>
NAME "\ os.rename('input.txt" AS', "\'output.txt"')
" python
 
$ "
import os
if os.path.exists('docs'):
file os.rename("'docs"', "'mydocs"')
" python
 
$ "
import os
if os.path.exists('/input.txt'):
<lang R>file os.rename("'/input.txt"', "'/output.txt"')
" python
 
$ "
import os
if os.path.exists('/docs'):
file os.rename("'/docs"', "'/mydocs"')</lang>
" python</lang>
 
=={{header|Racket}}==
1,462

edits