MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetFileSize

Method GetFileSize

tensorflow/core/platform/windows/windows_file_system.cc:476–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474}
475
476Status WindowsFileSystem::GetFileSize(const string& fname, uint64* size) {
477 string translated_fname = TranslateName(fname);
478 std::wstring ws_translated_dir = Utf8ToWideChar(translated_fname);
479 Status result;
480 WIN32_FILE_ATTRIBUTE_DATA attrs;
481 if (TRUE == ::GetFileAttributesExW(ws_translated_dir.c_str(),
482 GetFileExInfoStandard, &attrs)) {
483 ULARGE_INTEGER file_size;
484 file_size.HighPart = attrs.nFileSizeHigh;
485 file_size.LowPart = attrs.nFileSizeLow;
486 *size = file_size.QuadPart;
487 } else {
488 string context = "Can not get size for: " + fname;
489 result = IOErrorFromWindowsError(context, ::GetLastError());
490 }
491 return result;
492}
493
494Status WindowsFileSystem::RenameFile(const string& src, const string& target) {
495 Status result;

Callers

nothing calls this directly

Calls 3

Utf8ToWideCharFunction · 0.85
IOErrorFromWindowsErrorFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected