MCPcopy Create free account
hub / github.com/clementgallet/libTAS / removeSaveFile

Function removeSaveFile

src/library/fileio/SaveFileList.cpp:214–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214int removeSaveFile(const char *file)
215{
216 std::lock_guard<std::mutex> lock(getSaveFileListMutex());
217
218 auto& savefiles = getSaveFileList();
219 for (const auto& savefile : savefiles) {
220 if (savefile->isSameFile(file)) {
221 return savefile->remove();
222 }
223 }
224
225 /* If the file is not registered, create a removed savefile */
226 if (Global::shared_config.prevent_savefiles) {
227 savefiles.emplace_front(new SaveFile(file));
228 savefiles.front()->remove();
229
230 GlobalNative gn;
231 return access(file, W_OK);
232 }
233
234 return 1;
235}
236
237int renameSaveFile(const char *oldfile, const char *newfile)
238{

Callers 2

removeFunction · 0.85
unlinkFunction · 0.85

Calls 4

accessFunction · 0.85
isSameFileMethod · 0.80
frontMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected