CopyFile

This function copies a file from one location to another.

Syntax

Parameters

Remarks

This function does not work on platforms that use virtual file systems, as mobile does.

This function will have no effect if Lua sandboxing is enabled.

Example

--Create a file
local path = "MyFile.txt"
FileSystem:CreateFile(path)

--Copy the file "MyFile.txt" as "MyFile2.txt"
local newpath = FileSystem:StripExt(path).."2."..FileSystem:ExtractExt(path)
FileSystem:CopyFile(path,newpath)