On 31-Jan-06, at 5:52 PM, Adam Ernst wrote:
On Jan 31, 2006, at 7:49 PM, Norman Palardy wrote:
if oldFile.Exists then f.CreationDate = oldFile.CreationDate
// oldFile probably exists. But I don't want to delete it
first--that would sacrifice safety.
if oldfile.exists then oldFile.delete
f.MoveFileTo oldFile
if f.LastErrorCode <> 0 then return false //
LastErrorCode=183, "file already exists"
That deletes the oldFile. What if the move then fails (permissions
error, or something)?
Then move it to the trashfolder instead of deleting it. At least you
can recover from that.
Move is just a MOVE, not a MOVE AND REPLACE
On Mac, it's a move and replace (I think).
Nope. You're thinking of Applescript. Check the LR and you will see
that it cannot exist.
However, if oldFile is "busy" you may not be able to remove it,
rename it or anything else
Yes. That's fine. I just want to replace it if it's not busy.
You will get a LastErrorCode response either way.
Terry
_______________________________________________
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>
|