v3.3.2: adjusted naming of Shattered's temp files to prevent conflicts
This commit is contained in:
@@ -85,9 +85,9 @@ public class FileUtils {
|
|||||||
} else if (file.length() == 0) {
|
} else if (file.length() == 0) {
|
||||||
file.delete();
|
file.delete();
|
||||||
} else {
|
} else {
|
||||||
if (file.name().endsWith(".tmp")){
|
if (file.name().endsWith(".spdtmp")){
|
||||||
FileHandle temp = file;
|
FileHandle temp = file;
|
||||||
FileHandle original = getFileHandle( defaultFileType, "", temp.path().replace(".tmp", "") );
|
FileHandle original = getFileHandle( defaultFileType, "", temp.path().replace(".spdtmp", "") );
|
||||||
|
|
||||||
//replace the base file with the temp one if base is invalid or temp is valid and newer
|
//replace the base file with the temp one if base is invalid or temp is valid and newer
|
||||||
try {
|
try {
|
||||||
@@ -204,7 +204,7 @@ public class FileUtils {
|
|||||||
//write to a temp file, then move the files.
|
//write to a temp file, then move the files.
|
||||||
// This helps prevent save corruption if writing is interrupted
|
// This helps prevent save corruption if writing is interrupted
|
||||||
if (file.exists()){
|
if (file.exists()){
|
||||||
FileHandle temp = getFileHandle(fileName + ".tmp");
|
FileHandle temp = getFileHandle(fileName + ".spdtmp");
|
||||||
bundleToStream(temp.write(false), bundle);
|
bundleToStream(temp.write(false), bundle);
|
||||||
file.delete();
|
file.delete();
|
||||||
temp.moveTo(file);
|
temp.moveTo(file);
|
||||||
|
|||||||
Reference in New Issue
Block a user