MCPcopy Create free account
hub / github.com/ElementsProject/elements / CheckDiskSpace

Function CheckDiskSpace

src/util/system.cpp:160–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160bool CheckDiskSpace(const fs::path& dir, uint64_t additional_bytes)
161{
162 constexpr uint64_t min_disk_space = 52428800; // 50 MiB
163
164 uint64_t free_bytes_available = fs::space(dir).available;
165 return free_bytes_available >= min_disk_space + additional_bytes;
166}
167
168std::streampos GetFileSize(const char* path, std::streamsize max) {
169 std::ifstream file{path, std::ios::binary};

Callers 3

AppInitMainFunction · 0.85
FlushStateToDiskMethod · 0.85
AllocateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected