Rename a file: Difference between revisions

(objc)
Line 45:
rename("/docs", "/mydocs")
)</lang>
=={{header|AWK}}==
Awk allows to call operating system commands with the ''system()'' function. However, the awk script won't get its output, only the return code. But this task is simple enough for the trivial implementation to work:
$ awk 'BEGIN{system("mv input.txt output.txt"}'
$ awk 'BEGIN{system("mv docs mydocs")}'
$ awk 'BEGIN{system("mv /input.txt /output.txt")}'
$ awk 'BEGIN{system("mv docs mydocs")}'
 
=={{header|C}}==
{{works with|gcc|4.1.2 20061115 (prerelease) (SUSE Linux)}}
Anonymous user