Rename a file: Difference between revisions
Content added Content deleted
(Added rust implementation) |
|||
Line 964: | Line 964: | ||
a$ = shell$("RENAME \input.txt \output.txt") |
a$ = shell$("RENAME \input.txt \output.txt") |
||
a$ = shell$("RENAME \docs \mydocs")</lang> |
a$ = shell$("RENAME \docs \mydocs")</lang> |
||
=={{header|Rust}}== |
|||
<lang rust> |
|||
use std::fs; |
|||
fn main() { |
|||
let err = "File move error"; |
|||
fs::rename("input.txt", "output.txt").ok().expect(err); |
|||
fs::rename("docs", "mydocs").ok().expect(err); |
|||
fs::rename("/input.txt", "/output.txt").ok().expect(err); |
|||
fs::rename("/docs", "/mydocs").ok().expect(err); |
|||
} |
|||
</lang> |
|||
=={{header|Scala}}== |
=={{header|Scala}}== |