MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / GetSize

Method GetSize

MonaBase/sources/FileSystem.cpp:188–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188UInt32 FileSystem::GetSize(Exception& ex,const char* path, size_t size, UInt32 defaultValue) {
189 Status status;
190 if (Stat(path, size, status)<=0) {
191 ex.set(Exception::FILE, path, " doesn't exist");
192 return defaultValue;
193 }
194 if (status.st_mode&S_IFDIR) { // if was a folder
195 ex.set(Exception::FILE, "GetSize works just on file, and ", path, " is a folder");
196 return defaultValue;
197 }
198 return (UInt32)status.st_size;
199}
200
201bool FileSystem::Exists(const char* path, size_t size) {
202 Status status;

Callers

nothing calls this directly

Calls 2

StatFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected