I implemented a solution to the problem meant to be cross-platform and adherent to the C++ standard library.
bool isdir(const char *string) {
ofstream file(string, ios::out);
return file.fail();
}
Yet, if the file is actually writable, the program opens an empty file with string
name in its working directory.
How can I prevent this from happening?