• 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: FSEventStream and rename notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FSEventStream and rename notifications


  • Subject: Re: FSEventStream and rename notifications
  • From: Jim Luther <email@hidden>
  • Date: Mon, 07 Mar 2016 08:01:15 -0800


On Mar 6, 2016, at 5:04 PM, James Bucanek <email@hidden> wrote:


tridiak
March 5, 2016 at 9:14 PM


I want a way to know a file what a file’s new name is.
Having event ID X (old name) & X+1 (new name) for file rename (& move) would be really useful.

Is there another way to find out what a file’s new name is? I am currently iterating through the parent directory comparing file sys IDs to get the new name.
A file's file ID will never changed under rename (or move*)?

A simpler approach would probably be to create a bookmark of the original file and make sure the bookmark data prefers the file ID (kCFURLBookmarkCreationPreferFileIDResolutionMask). Then, all you have to do is resolve the bookmark and get the file's new name and location (from the returned file URL). Very fast, very neat.

That won’t work. kCFURLBookmarkCreationPreferFileIDResolutionMask was never implemented and the option didn’t make sense anyway (if anything, it should have been a resolution option, not a creation option).

    // deprecated
    kCFURLBookmarkCreationPreferFileIDResolutionMask CF_ENUM_DEPRECATED(10_6, 10_9, 4_0, 7_0, "kCFURLBookmarkCreationPreferFileIDResolutionMask does nothing and has no effect on bookmark resolution" ) = ( 1UL << 8 ),


Optionally, if you use NSURL to create the bookmark, you can include the URL's original filename (as an URL resource) in the bookmark data. Later, the bookmark will provide both the original name (saved during creation) and its new name (obtained after resolution).

Do not post admin requests to the list. They will be ignored. Filesystem-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: FSEventStream and rename notifications
      • From: James Bucanek <email@hidden>
References: 
 >FSEventStream and rename notifications (From: tridiak <email@hidden>)
 >Re: FSEventStream and rename notifications (From: tridiak <email@hidden>)
 >Re: FSEventStream and rename notifications (From: James Bucanek <email@hidden>)

  • Prev by Date: Re: FSEventStream and rename notifications
  • Next by Date: Re: FSEventStream and rename notifications
  • Previous by thread: Re: FSEventStream and rename notifications
  • Next by thread: Re: FSEventStream and rename notifications
  • Index(es):
    • Date
    • Thread