Difference between revisions of "Fs.move"
From ComputerCraft Wiki
(Admiration Computer) |
(Copy description from API page and use type template) |
||
| (6 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | {{lowercase}} | |
| − | + | {{Function | |
| + | |name=fs.move | ||
| + | |args={{Type|string}} fromPath, {{Type|string}} toPath | ||
| + | |api=fs | ||
| + | |desc=Moves a file or directory to a new location. The parent of the new location must be an existing, writable directory, <var>toPath</var> must include the target filename and cannot be only a directory to move the file into, and <var>toPath</var> itself must not already exist. | ||
| + | |examples= | ||
| + | {{Example | ||
| + | |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") | ||
| + | }} | ||
| + | }} | ||
| + | |||
| + | [[Category:Lua_Core_Functions]] | ||
Latest revision as of 19:43, 22 April 2013
| Moves a file or directory to a new location. The parent of the new location must be an existing, writable 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
| 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")
|