aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src/file_io_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/src/file_io_utils.cpp')
-rw-r--r--contrib/epee/src/file_io_utils.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/contrib/epee/src/file_io_utils.cpp b/contrib/epee/src/file_io_utils.cpp
index c0798a510..bc592cb9f 100644
--- a/contrib/epee/src/file_io_utils.cpp
+++ b/contrib/epee/src/file_io_utils.cpp
@@ -149,40 +149,5 @@ namespace file_io_utils
}
#endif
}
-
-
- bool get_file_size(const std::string& path_to_file, uint64_t &size)
- {
-#ifdef _WIN32
- std::wstring wide_path;
- try { wide_path = string_tools::utf8_to_utf16(path_to_file); } catch (...) { return false; }
- HANDLE file_handle = CreateFileW(wide_path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (file_handle == INVALID_HANDLE_VALUE)
- return false;
- LARGE_INTEGER file_size;
- BOOL result = GetFileSizeEx(file_handle, &file_size);
- CloseHandle(file_handle);
- if (result) {
- size = file_size.QuadPart;
- }
- return size;
-#else
- try
- {
- std::ifstream fstream;
- fstream.exceptions(std::ifstream::failbit | std::ifstream::badbit);
- fstream.open(path_to_file, std::ios_base::binary | std::ios_base::in | std::ios::ate);
- size = fstream.tellg();
- fstream.close();
- return true;
- }
-
- catch(...)
- {
- return false;
- }
-#endif
- }
-
}
}