So i'm trying to see if it fails, but if i change "Input" name would the computer just create a new file name of it for example if i change "Input" to "asdf" the computer is just going to create "asdf" how do i fix it. Thanks!
I had to check for a file at some point and found this lying on the net somewhere.
Would like to give credit to whomever made it but cant remember the name.
anyhow this checks if file exists. i think :)
1 2 3 4 5 6 7 8 9 10 11 12
#include <sys/stat.h>
bool fileExists(const std::string& filename)
{
struct stat buf;
if (stat(filename.c_str(), &buf) != -1)
{
returntrue;
}
returnfalse;
}