MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / BackupFile

Function BackupFile

roomedit/source/save.cpp:1042–1061  ·  view source on GitHub ↗

/ * BackupFile: Copy fname to a backup name if it already exists. * Return True iff successful. */

Source from the content-addressed store, hash-verified

1040 * Return True iff successful.
1041 */
1042Bool BackupFile(char *fname)
1043{
1044 struct stat s;
1045 char bname[MAX_PATH];
1046
1047 // Do nothing if no file exists
1048 if (stat(fname, &s) == -1)
1049 return True;
1050
1051 strcpy(bname, fname);
1052 strcat(bname, "~");
1053
1054 if (CopyFile(fname, bname, FALSE) == FALSE)
1055 {
1056 if (MessageBox(NULL, "Can't make backup room file.\nSave anyway?", "Warning",
1057 MB_YESNO | MB_DEFBUTTON2) == IDNO)
1058 return False;
1059 }
1060 return True;
1061}
1062/***************************************************************************/
1063/*
1064 * SetWallHeights: Fill in wall heights from adjacent sector heights.

Callers 1

SaveLevelDataFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected