I tired to get the file size in Visual studio C++. The first step getting the handle of the file is failing. I checked there is a file in that full path. Any idea why the handle is invalid here? I got the error code 6 which is how I know the handle is invalid.
HANDLE hFile = CreateFile(fullPath.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
LARGE_INTEGER size;
if (!GetFileSizeEx(hFile, &size))
size.QuadPart = 0;
CloseHandle(hFile);
Aucun commentaire:
Enregistrer un commentaire