I'm trying to save a file the 'safe' way, by creating a temporary
file, saving the data to there, and then moving that temporary file
on top of the existing file. But on Windows, I get error 183, "file
already exists". Here's my code:
if oldFile.Exists then f.CreationDate = oldFile.CreationDate
// oldFile probably exists. But I don't want to delete it first--
that would sacrifice safety.
f.MoveFileTo oldFile
if f.LastErrorCode <> 0 then return false // LastErrorCode=183,
"file already exists"
Any suggestions? What's the "proper" way to do this?
Thanks,
Adam Ernst
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|