RenameFile
This function renames a file.
Syntax
- static bool RenameFile(const std::string& src, const std::string& dst)
Parameters
- src: the full path to the file to rename.
- dst: the new name of the file, without the full path.
Returns
Returns true if the directory was renamed, otherwise false is returned.
Remarks
This function will have no effect if Lua sandboxing is enabled.
Example
#include "Leadwerks.h"
using namespace Leadwerks;
int main(int argc, const char *argv[])
{
//Create a file
std::string path = "MyFile.txt";
FileSystem::CreateFile(path);
FileSystem::RenameFile(path,"MyNewFile.txt");
return 0;
}