IO group



The file mode to put the file stream in.

IO::FileMode::None = 0
IO::FileMode::Read = 1
IO::FileMode::Write = 2
IO::FileMode::Append = 3

IO::File Manages a file reading or writing stream.

IO::FileSource Manages a file reading stream from a file source, such as a plugin's zip or folder contents.

Global functions

string IO::FromDataFolder(const string&in filename) Gets the absolute path for a file in the data folder. This is typically C:\Users\Username\OpenplanetNext

string IO::FromAppFolder(const string&in filename) Gets the absolute path for a file in the game's applicationfolder. This is where your game is installed, for example D:\Games\Trackmania

bool IO::FileExists(const string&in filename) Checks if the given path exists.

uint64 IO::FileSize(const string&in filename) Gets the size of the given file.

void IO::Delete(const string&in filename) Deletes the given file.

void IO::Move(const string&in filename, const string&in target) Moves the given file.

bool IO::FolderExists(const string&in path) Checks if the given path exists.

void IO::CreateFolder(const string&in path, bool recursive = true) Creates a folder at the given location.

string[]@ IO::IndexFolder(const string&in path, bool recursive) Lists files and folders in the current folder. If recursive is true, it will only return files.

void IO::SetClipboard(const wstring&in text) Copies text on the clipboard.