534
533
sprintf(szPathBak, "%s.bak%d", szPath, nBakIdx);
536
535
//rename .bak file if already exists
543
538
//then rename existing file as .bak (to make room for new file)
551
542
//error creating backup file
562
549
//quick FIX: delete target file if it already exists
563
550
//TOFIX more precise fix would be to test/fix file open flags when saving
571
554
//move temporary file to target path
578
557
return DOC_SAVE_ERR_OVERWRITE; // Failed to owerwrite target file