MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / sweepTempFiles

Method sweepTempFiles

switch/source/transfer.cpp:530–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530void Transfer::sweepTempFiles(void)
531{
532 if (io::fileExists(TEMP_UPLOAD)) {
533 std::remove(TEMP_UPLOAD);
534 Logging::info("Removed leftover {} from a previous run.", TEMP_UPLOAD);
535 }
536
537 Directory dir(CHECKPOINT_ROOT);
538 if (!dir.good()) {
539 return;
540 }
541 for (size_t i = 0, sz = dir.size(); i < sz; i++) {
542 if (dir.folder(i)) {
543 continue;
544 }
545 std::string name = dir.entry(i);
546 if (name.size() > TEMP_SEND_PREFIX.size() + TEMP_SEND_SUFFIX.size() && name.compare(0, TEMP_SEND_PREFIX.size(), TEMP_SEND_PREFIX) == 0 &&
547 name.compare(name.size() - TEMP_SEND_SUFFIX.size(), TEMP_SEND_SUFFIX.size(), TEMP_SEND_SUFFIX) == 0) {
548 std::string path = std::string(CHECKPOINT_ROOT) + name;
549 std::remove(path.c_str());
550 Logging::info("Removed leftover {} from a previous run.", name);
551 }
552 }
553}
554
555bool Transfer::startReceiver(std::string& outError)
556{

Callers

nothing calls this directly

Calls 7

infoFunction · 0.85
stringFunction · 0.85
compareMethod · 0.80
goodMethod · 0.45
sizeMethod · 0.45
folderMethod · 0.45
entryMethod · 0.45

Tested by

no test coverage detected