#include <sys/stat.h>
#include <io.h>
bool FileExist(const char* FileName)
{
struct stat my_stat;
return (stat(FileName, &my_stat) == 0);
}
bool IsDirectory(const char* FileName)
{
struct stat my_stat;
if (stat(FileName, &my_stat) != 0) return false;
return ((my_stat.st_mode & S_IFDIR) != 0);
}