CopyDir
This function copies a directory from one location to another.
Syntax
- static bool CopyDir(const std::string& src, const std::string& dst)
Parameters
- src: this is the directory to copy.
- dst: this is the path to the new directory to create.
Remarks
This function will have no effect if Lua sandboxing is enabled.
This function does not work on platforms that use virtual file systems, as mobile does.
Example
#include "Leadwerks.h"
using namespace Leadwerks;
Entity* entity = NULL;
int main(int argc, const char *argv[])
{
//Create a file
std::string path = "MyDir";
FileSystem::CreateDir(path);
//Copy the folder "MyDir" as "MyDir2"
std::string newpath = path + "2";
FileSystem::CopyDir(path, newpath);
return 0;
}