fs.move

From ComputerCraft
Jump to: navigation, search

fs.move
Function
Syntax
fs.move()
Returns nil
API fs
Source CC:Tweaked (source)

Moves the file at the path path to the path dest. This is effectively equivalent to renaming the file.

The function will create any directories necessary, meaning you can move a file to /foo/bar/ and it will create the directory /foo if it does not already exist.

If path dest already exists, the function will error. This means you cannot move a directory into another directory, instead you will have to manually move all the files inside of it.

ExampleExampleMove a directory
Creates the directory /foo and moves it to /bar
Code
fs.makeDir("/foo")
fs.move("/foo", "/bar")