Rename a file: Difference between revisions

→‎{{header|REBOL}}: Added ftp example.
(→‎{{header|R}}: Added REBOL example.)
(→‎{{header|REBOL}}: Added ftp example.)
Line 323:
rename %docs/ %mydocs/
 
; Unix. Note that there's no path specification used for the
rename %/input.txt %/output.txt
; new name. "Rename" is not "move".
rename %/docs/ %/mydocs/
 
rename %/input.txt %/output.txt
rename %/docs/ %/mydocs/
 
; DOS/Windows:
 
rename %/c/input.txt %/c/output.txt
rename %/c/docs/ %mydocs/
; For whatever reason, it seems you have to change to the drive root to rename directories there.
 
x: what-dir change-dir %/c/ rename %docs/ %mydocs/ change-dir x
; Because REBOL treats data access schemes as uniformly as possible,
; you can do tricks like this:
 
rename ftp://username:password@ftp.site.com/www/input.txt %output.txt
rename ftp://username:password@ftp.site.com/www/docs/ %mydocs/
</lang>
 
Anonymous user