Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Spotlight to watch for file change



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Using Spotlight to watch for file change (From: Tim Gogolin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.