我实施了一个解决问题的办法,目的是要跨平台,并遵守C++标准图书馆。
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?