MCPcopy Create free account
hub / github.com/BruceDevices/firmware / getFileSize

Function getFileSize

src/core/sd_functions.cpp:438–444  ·  view source on GitHub ↗

** Function name: getFileSize ** Description: get a file size without opening ***************************************************************************************/

Source from the content-addressed store, hash-verified

436** Description: get a file size without opening
437***************************************************************************************/
438size_t getFileSize(FS &fs, String filepath) {
439 File file = fs.open(filepath, FILE_READ);
440 if (!file) return 0;
441 size_t fileSize = file.size();
442 file.close();
443 return fileSize;
444}
445
446String md5File(FS &fs, String filepath) {
447 if (!fs.exists(filepath)) return "";

Callers 1

loopSDFunction · 0.85

Calls 2

sizeMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected