version 1.25, 2008/12/02 09:02:07
|
version 1.26, 2009/02/04 04:48:35
|
|
|
is.close(); | is.close(); |
os.close(); | os.close(); |
| |
// 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 both tmp and original files |
|
FileSystem::removeFile(tmpPath); |
|
FileSystem::removeFile(path); |
|
} |
| |
return found; | return found; |
} | } |