MCPcopy Create free account
hub / github.com/comaps/comaps / GetFileSizeByFullPath

Method GetFileSizeByFullPath

libs/platform/platform_win.cpp:195–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195bool Platform::GetFileSizeByFullPath(std::string const & filePath, uint64_t & size)
196{
197 HANDLE hFile =
198 CreateFileA(filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
199 if (hFile != INVALID_HANDLE_VALUE)
200 {
201 SCOPE_GUARD(autoClose, bind(&CloseHandle, hFile));
202 LARGE_INTEGER fileSize;
203 if (0 != GetFileSizeEx(hFile, &fileSize))
204 {
205 size = fileSize.QuadPart;
206 return true;
207 }
208 }
209 return false;
210}
211
212namespace
213{

Callers 3

SyncWithDiskMethod · 0.45
UNIT_TESTFunction · 0.45
UNIT_TESTFunction · 0.45

Calls

no outgoing calls

Tested by 2

UNIT_TESTFunction · 0.36
UNIT_TESTFunction · 0.36