MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / getFileSize

Method getFileSize

src/helper.cpp:497–501  ·  view source on GitHub ↗

https://stackoverflow.com/questions/5840148/how-can-i-get-a-files-size-in-c

Source from the content-addressed store, hash-verified

495
496// https://stackoverflow.com/questions/5840148/how-can-i-get-a-files-size-in-c
497long Helper::getFileSize(std::string filename) {
498 struct stat stat_buf;
499 int rc = stat(filename.c_str(), &stat_buf);
500 return rc == 0 ? stat_buf.st_size : -1;
501}
502
503
504/*

Callers

nothing calls this directly

Calls 1

statClass · 0.70

Tested by

no test coverage detected