MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / get_filesize

Function get_filesize

include/rabitqlib/utils/io.hpp:13–22  ·  view source on GitHub ↗

get num of bytes

Source from the content-addressed store, hash-verified

11namespace rabitqlib {
12// get num of bytes
13inline size_t get_filesize(const char* filename) noexcept {
14 try {
15 return std::filesystem::file_size(filename);
16 } catch (const std::filesystem::filesystem_error& e) {
17 // Log the error and return -1 to maintain original behavior on error.
18 std::cerr << "Error getting file size for '" << filename << "': " << e.what()
19 << '\n';
20 return static_cast<size_t>(-1);
21 }
22}
23
24inline bool file_exists(const char* filename) { return std::filesystem::exists(filename); }
25

Callers 1

load_vecsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected