File:move(path) method

Moves the file physically on the disk to the specified path.

Parameters

path

A string representing the destination path.

Return value

Returns true if the operation succeeded or false otherwise (if a file is open in another program for example).

Example

local file = sys.File("test.txt"):open("write") file:writeln("Hello World !") file:close() -- rename file from "test.txt" to "hello.txt" file:move("hello.txt")