Rename a file: Difference between revisions
Added Quackery.
Thundergnat (talk | contribs) m (→{{header|Processing}}: fix bogus markup) |
(Added Quackery.) |
||
Line 1,098:
shutil.move("/docs", "/mydocs")</lang>
=={{header|
NAME "\input.txt" AS "\output.txt"▼
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.
<lang R>file.rename("input.txt", "output.txt")▼
<lang Quackery> $ "
import os
file.rename("docs", "mydocs")▼
if os.path.exists('input.txt'):
file.rename("/docs", "/mydocs")</lang>▼
" python
$ "
import os
if os.path.exists('docs'):
" python
$ "
import os
if os.path.exists('/input.txt'):
" python
$ "
import os
if os.path.exists('/docs'):
" python</lang>
=={{header|Racket}}==
|