• 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: Using Spotlight to watch for file change
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Spotlight to watch for file change


  • Subject: Re: Using Spotlight to watch for file change
  • From: Rosyna <email@hidden>
  • Date: Wed, 14 Sep 2005 22:13:16 -0700

Use kqueue.

There is some very, very good sample code at http://developer.apple.com/samplecode/FileNotification/FileNotification.html

Note that this won't work for file changes that don't go through the kernel such as files changing on network volumes from a computer that isn't the one with the code running on it (this is the same limitation that spotlight has, of course).

Ack, at 9/14/05, Tim Gogolin said:

I'd like to watch one or more specific files to see if an external program has modified them.

Three methods immediately pop to my mind:
    kqueue (which I know almost nothing about),
    Spotlight (which seems like it ought to be the right answer)
    polling the file mod date (which I'd like to avoid)

--


Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
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: 
 >Using Spotlight to watch for file change (From: Tim Gogolin <email@hidden>)

  • Prev by Date: Re: cancel editing text in a row
  • Next by Date: Re: Simple question
  • Previous by thread: Using Spotlight to watch for file change
  • Next by thread: radio buttons
  • Index(es):
    • Date
    • Thread