I have a piece of code to run on Windows that uses char const for a filename:
char const * filename
_finddata_t fi;
intptr_t n;
if ((n = _findfirst(filename, &fi)) != -1) {
_findclose(n);
return TRUE;
}
Now I want this to use this code using const wchar_t for a filename (it should still run on Windows). I would assume this would be the way to do (see below). But in the description of _wfindclose it says _wfindclose is only usable for Win NT. Since one should use _wfindclose() to close the handle: **How do I close the handle in Win64? **
wchar_t const * filename
_wfinddata_t fi;
intptr_t n;
if ((n = _wfindfirst(filename, &fi)) != -1) {
_wfindclose(n);
return TRUE;
}