Re: Trashing files and undo
Re: Trashing files and undo
- Subject: Re: Trashing files and undo
- From: Charles Srstka <email@hidden>
- Date: Fri, 11 Jul 2008 11:11:33 -0500
On Jul 11, 2008, at 10:54 AM, Sean McBride wrote:
Unless of course between trashing the file and trying to undo the
trashing, a file of the same name as the trashed item is put in its
old
location. 1) that would cause the wrong alias resolution (since
aliases
resolve by path first) and 2) it would make restoring the trashed
file tricky.
I think it is very hard to get all the edge cases. Maybe if you
script
the finder to trash the file, then the finder's undo would be
available.
With aliases, there's a kResolveAliasTryFileIDFirst constant that will
avoid this situation, although if you just use FSRefs, I don't think
they keep track of the path at all, so that should always track the
same file node no matter what.
At any rate, if you do the resolution immediately after performing the
trash operation, this should prevent this situation from happening in
the first place.
Charles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden