• 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: File changed notification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File changed notification


  • Subject: Re: File changed notification
  • From: Uli Kusterer <email@hidden>
  • Date: Fri, 4 Aug 2006 20:33:53 +0200

Am 04.08.2006 um 17:47 schrieb Paul Schulze:
Is there a recommended way to listen to changes of files? I'm trying to write an application, that provides information about various files, that may be distributed over the whole home directory of a user. I would like to simply register the file, I'm watching and then get an event call on changes. Is there any way to do this? Couldn't find anything by now, so any hint would be nice.

If you can require 10.3 or later, kqueue is your friend. If you want a Cocoa wrapper, I wrote one:


	http://www.zathras.de/angelweb/sourcecode.htm#UKKQueue

It also contains an FNSubscribe-based file watching mechanism, which is the other scheme Apple provides. Both have their advantages and disadvantages.

Be careful, though. Many apps (especially Cocoa ones) don't change files, but rather write a new one with the changed contents and then swap them out once the new one has successfully been written. So, you may only get one "delete" notification instead of a change.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >File changed notification (From: Paul Schulze <email@hidden>)

  • Prev by Date: Re: Cocoa doesn't use my fonts - all fonts are system fonts
  • Next by Date: Re: resolving aliases
  • Previous by thread: Re: File changed notification
  • Next by thread: Need Help Displaying a Floating-Point Image
  • Index(es):
    • Date
    • Thread