MCPcopy Create free account
hub / github.com/VCVRack/Rack / fileEndsWith

Function fileEndsWith

src/logger.cpp:21–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21static bool fileEndsWith(FILE* file, std::string str) {
22 // Seek to last `len` characters
23 size_t len = str.size();
24 std::fseek(file, -long(len), SEEK_END);
25 char actual[len];
26 if (std::fread(actual, 1, len, file) != len)
27 return false;
28 return std::string(actual, len) == str;
29}
30
31static bool isTruncated() {
32 if (logPath.empty())

Callers 1

isTruncatedFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected