mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-06 13:30:00 +00:00
sceSaveDataRestoreBackupData used to remove the live save's files and copy the backup over them, so a copy that failed half way left neither. It now copies the backup, its .param and its blocks file to _sd_restore_tmp/<dir>, checks that the copy has every entry at its size, and flushes it. Then it moves the live save, .param and blocks file to _sd_restore_old/<dir>, moves the staged copy into place and removes the old one. A failed move puts back everything already moved, so the live save stays as it was. The staging roots sit next to _sd, not in it, where sceSaveDataDirNameSearch would list them. SaveDataSetFileStepHook_nid_no_patch sets a function that is called before each copy and rename of the backup and restore paths with a step name and the path written; when it returns false that step fails. It does nothing unless a test sets it.