fs.move

From ComputerCraft Wiki
Revision as of 20:13, 7 July 2012 by Pinkishu (Talk | contribs) (Undo revision 1969 by 91.121.27.33 (talk))

Jump to: navigation, search


Grid Redstone.png  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

Grid paper.png  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")