Jump to content

Rename a file: Difference between revisions

→‎{{header|Tcl}}: Note that 'file nativename' is usually unnecessary
(add E example)
(→‎{{header|Tcl}}: Note that 'file nativename' is usually unnecessary)
Line 261:
=={{header|Tcl}}==
<i>Assuming</i> that the Bash example shows what is actually meant with this task (one file and one directory here, one file and one directory in the root) and further assuming that this is supposed to be generic (i.e. OS agnostic):
<lang tcl>file rename inputs.txt output.txt
 
file rename inputs.txtdocs output.txtmydocs
file rename docs mydocs
file rename [file nativename /inputs.txt] [file nativename /output.txt]
file rename [file nativename /docs] [file nativename /mydocs]</lang>
Without the need to work on unusual platforms like Mac OS 9, the code could be just:
<lang tcl>file rename inputs.txt output.txt
file rename docs mydocs
file rename /inputs.txt /output.txt
file rename /docs /mydocs</lang>
 
=={{header|Toka}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.