Reputation: 3133
I wanted a means of checking is a file exists on the disk based on wchar_t * path. A ready to use method is available on SO but for char * path. Is there a variant for wchar_t * without using boost.
Upvotes: 1
Views: 896
Reputation: 6667
Loot at this example:
#include <fstream>
#include <string>
bool check_if_file_exists(std::wstring path)
{
std::ifstream ff(path.c_str());
return ff.is_open();
}
But this is windows only, since std::ifstream(wchar_t*) is MSVC extension.
Upvotes: 1