CopyFile
This function copies a file from one location to another.
Syntax
- bool CopyFile(string src,string dst)
Parameters
- src: this is the path of the file to copy.
- dst: this is the path to the new file that will be created.
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)