8 #include "CheckpointEntry.hpp" 9 #include "io/fileio.hpp" 10 #include "utils/PVLog.hpp" 18 std::string CheckpointEntry::generatePath(
19 std::string
const &checkpointDirectory,
20 std::string
const &extension)
const {
21 std::string path{checkpointDirectory};
22 path.append(
"/").append(getName()).append(
".").append(extension);
26 void CheckpointEntry::deleteFile(
27 std::string
const &checkpointDirectory,
28 std::string
const &extension)
const {
29 if (getMPIBlock()->getRank() == 0) {
30 std::string path = generatePath(checkpointDirectory, extension);
32 int statstatus = stat(path.c_str(), &pathStat);
33 if (statstatus == 0) {
34 int unlinkstatus = unlink(path.c_str());
35 if (unlinkstatus != 0) {
36 Fatal().printf(
"Failure deleting \"%s\": %s\n", path.c_str(), strerror(errno));