• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trashing files and undo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Trashing files and undo
      • From: Ken Thomases <email@hidden>
References: 
 >Re: Trashing files and undo (From: Gregory Weston <email@hidden>)
 >Re: Trashing files and undo (From: glenn andreas <email@hidden>)
 >Re: Trashing files and undo (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: garbage collection and NSConnection
  • Next by Date: KVO notifications and threads
  • Previous by thread: Re: Trashing files and undo
  • Next by thread: Re: Trashing files and undo
  • Index(es):
    • Date
    • Thread