Skip to content

Commit 92c0ccd

Browse files
committed
Use GetFileAttributesEx to get the config file attributes
1 parent 21cdc06 commit 92c0ccd

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/common/config/ConfigCache.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,17 @@ Firebird::PathName ConfigCache::getFileName()
8585
#ifdef WIN_NT
8686
void ConfigCache::File::getTime(DWORD& timeLow, DWORD& timeHigh)
8787
{
88-
WIN32_FIND_DATA findFileData;
89-
HANDLE hFind = FindFirstFile(fileName.c_str(), &findFileData);
88+
WIN32_FILE_ATTRIBUTE_DATA fInfo;
9089

91-
if (hFind == INVALID_HANDLE_VALUE)
90+
if (!GetFileAttributesEx(fileName.c_str(), GetFileExInfoStandard, &fInfo))
9291
{
9392
timeLow = 0;
9493
timeHigh = 0;
9594
return;
9695
}
9796

98-
FindClose(hFind);
99-
timeLow = findFileData.ftLastWriteTime.dwLowDateTime;
100-
timeHigh = findFileData.ftLastWriteTime.dwHighDateTime;
97+
timeLow = fInfo.ftLastWriteTime.dwLowDateTime;
98+
timeHigh = fInfo.ftLastWriteTime.dwHighDateTime;
10199
}
102100
#else
103101
void ConfigCache::File::getTime(timespec& time)

0 commit comments

Comments
 (0)