Difference between revisions of "Fs.move"
From ComputerCraft Wiki
(Create page) |
(Example has no output) |
||
Line 9: | Line 9: | ||
|desc=Renames a file from "test1" to "test2" and moves it from the root directory into a directory called "mydir" | |desc=Renames a file from "test1" to "test2" and moves it from the root directory into a directory called "mydir" | ||
|code=fs.move("test1", "mydir/test2") | |code=fs.move("test1", "mydir/test2") | ||
− | |||
}} | }} | ||
}} | }} |
Revision as of 04:10, 12 March 2012
Function fs.move | |
Moves a file or directory to a new location (the parent of the new location must be a directory, toPath must include the target filename and cannot be only a directory to move the file into, and toPath itself must not already exist) | |
Syntax | fs.move(string fromPath, string toPath) |
Returns | nil |
Part of | ComputerCraft |
API | fs |
Examples
Example | |
Renames a file from "test1" to "test2" and moves it from the root directory into a directory called "mydir" | |
Code |
fs.move("test1", "mydir/test2") |