Rename a file: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
|||
Line 57: | Line 57: | ||
rename("/docs", "/mydocs") |
rename("/docs", "/mydocs") |
||
)</lang> |
)</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |
||
Line 73: | Line 66: | ||
DirMove("docs", "mydocs") |
DirMove("docs", "mydocs") |
||
DirMove("\docs", "\mydocs") |
DirMove("\docs", "\mydocs") |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|BaCon}}== |
=={{header|BaCon}}== |
||
Line 151: | Line 151: | ||
rename("/docs", "/mydocs"); |
rename("/docs", "/mydocs"); |
||
return 0; |
return 0; |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
}</lang> |
}</lang> |
||
Line 187: | Line 202: | ||
boost::filesystem::path("/mydocs"));*/ |
boost::filesystem::path("/mydocs"));*/ |
||
return 0; |
return 0; |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
}</lang> |
}</lang> |
||
Line 869: | Line 869: | ||
The core <code>rename($oldfile,$newfile)</code> can rename a file within a directory, but has the usual limitations of the <code>rename()</code> system call or C library function, which means generally not working across filesystems, and perhaps not working to rename directories. <code>move()</code> does a copy and delete when necessary. |
The core <code>rename($oldfile,$newfile)</code> can rename a file within a directory, but has the usual limitations of the <code>rename()</code> system call or C library function, which means generally not working across filesystems, and perhaps not working to rename directories. <code>move()</code> does a copy and delete when necessary. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Line 1,005: | Line 999: | ||
(build-path root "mydocs")) |
(build-path root "mydocs")) |
||
</lang> |
</lang> |
||
⚫ | |||
(formerly Perl 6) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Raven}}== |
=={{header|Raven}}== |
||
Line 1,323: | Line 1,324: | ||
IO.File.Move(IO.Path.DirectorySeparatorChar & "input.txt", _ |
IO.File.Move(IO.Path.DirectorySeparatorChar & "input.txt", _ |
||
IO.Path.DirectorySeparatorChar & "output.txt")</lang> |
IO.Path.DirectorySeparatorChar & "output.txt")</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Yabasic}}== |
=={{header|Yabasic}}== |
||
Line 1,342: | Line 1,336: | ||
system(com$ + slash$ + "input.txt " + slash$ + "output.txt") |
system(com$ + slash$ + "input.txt " + slash$ + "output.txt") |
||
system(com$ + slash$ + "docs " + slash$ + "mydocs")</lang> |
system(com$ + slash$ + "docs " + slash$ + "mydocs")</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|zkl}}== |
=={{header|zkl}}== |