|
|
@ -80,12 +80,13 @@ std::size_t count_files(const std::string &folder)
|
|
|
|
HANDLE hFind = INVALID_HANDLE_VALUE;
|
|
|
|
HANDLE hFind = INVALID_HANDLE_VALUE;
|
|
|
|
|
|
|
|
|
|
|
|
// Start iterating over the files in the path directory.
|
|
|
|
// Start iterating over the files in the path directory.
|
|
|
|
hFind = ::FindFirstFileA(folder.c_str(), &ffd);
|
|
|
|
hFind = ::FindFirstFileA((folder + "\\*.*").c_str(), &ffd);
|
|
|
|
if (hFind != INVALID_HANDLE_VALUE)
|
|
|
|
if (hFind != INVALID_HANDLE_VALUE)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
do // Managed to locate and create an handle to that folder.
|
|
|
|
do // Managed to locate and create an handle to that folder.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
counter++;
|
|
|
|
if (ffd.cFileName[0] != '.')
|
|
|
|
|
|
|
|
counter++;
|
|
|
|
} while (::FindNextFile(hFind, &ffd) == TRUE);
|
|
|
|
} while (::FindNextFile(hFind, &ffd) == TRUE);
|
|
|
|
::FindClose(hFind);
|
|
|
|
::FindClose(hFind);
|
|
|
|
}
|
|
|
|
}
|
|
|
|