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

#include "Leadwerks.h"

using namespace Leadwerks;

Entity* entity = NULL;

int main(int argc, const char *argv[])
{
//Create a file
std::string path = "MyFile.txt";
FileSystem::CreateFile(path);

//Copy the file "MyFile.txt" as "MyFile2.txt"
std::string newpath = FileSystem::StripExt(path)+"2."+FileSystem::ExtractExt(path);
FileSystem::CopyFile(path,newpath);

return 0;
}