GetFileType
This function gets the file type of a file.
Syntax
- static int GetFileType(const std:string& path)
Parameters
- path: the path to the file to get the type of.
Returns
If the specified path if a file, FileSystem::File is returned. If the specified path is a directory, FileSystem::Dir is returned. If the file does not exist, 0 is returned.
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);
//This will print the value of FileSystem::File
System::Print(FileSystem::GetFileType(path));
return 0;
}