Jump to content

Rename a file: Difference between revisions

Added Elixir
No edit summary
(Added Elixir)
Line 23:
* file extension syntax;
* file system root (provided there is any).
 
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Standard - no extensions to language used}}
Line 182 ⟶ 183:
}
}</lang>
 
 
=={{header|Clipper}}==
Line 222:
std.file.rename("docs","mydocs");
std.file.rename("/docs","/mydocs");</lang>
 
=={{header|DCL}}==
<lang DCL>rename input.txt output.txt
Line 250 ⟶ 251:
where["docs"].renameTo(where["mydocs"], null)
}</lang>
 
=={{header|Elixir}}==
<lang elixir>File.rename "input.txt","output.txt"
File.rename "docs", "mydocs"
File.rename "/input.txt", "/output.txt"
File.rename "/docs", "/mydocs"</lang>
 
=={{header|Emacs Lisp}}==
Line 355 ⟶ 362:
}
}</lang>
 
 
=={{header|Harbour}}==
Line 532 ⟶ 538:
rename file "/input.txt" to "/output.txt"
rename folder "/docs" to "/mydocs"</lang>
 
 
=={{header|Locomotive Basic}}==
Line 560 ⟶ 565:
RenameFile["input.txt", "output.txt"]
RenameDirectory["docs", "mydocs"]</lang>
 
 
=={{header|MATLAB}} / {{header|Octave}}==
Line 966 ⟶ 970:
moves = { "input.txt" => "output.txt", "/input.txt" => "/output.txt", "docs" => "mydocs","/docs" => "/mydocs"}
moves.each{ |src, dest| FileUtils.move( src, dest, :verbose => true ) }</lang>
 
=={{header|Run BASIC}}==
RB has no direct command. You Shell out to windows or unix.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.