version 1.27, 2008/06/19 17:49:53
|
version 1.27.4.1, 2009/02/04 09:18:42
|
|
|
if (!FileSystem::removeFile(path)) | if (!FileSystem::removeFile(path)) |
throw CannotRemoveFile(path); | throw CannotRemoveFile(path); |
| |
// Rename back to original name: |
// Rename back to original if tmp file is not empty |
|
Uint32 size = 0; |
|
Boolean gotFileSize = FileSystem::getFileSize(tmpPath, size); |
|
if (size || !gotFileSize) |
|
{ |
if (!FileSystem::renameFile(tmpPath, path)) | if (!FileSystem::renameFile(tmpPath, path)) |
|
{ |
throw CannotRenameFile(path); | throw CannotRenameFile(path); |
|
} |
|
} |
|
else |
|
{ |
|
// Delete tmp and original files |
|
FileSystem::removeFile(tmpPath); |
|
FileSystem::removeFile(path); |
|
} |
| |
// Update cache | // Update cache |
if (found) | if (found) |