inotify for Mac?

Joined
Apr 3, 2008
Messages
16
Reaction score
0
Points
1
Hello all,

Is there any inotify-like library for Mac so that it provides file systems events without pooling?

I have read spotlight uses something like this but it is not accessible to the programmers so is there anything out there for us?

Cheers,

Paulo Matos
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
From Apple's developer website:

FSEvents API
Introduced in Mac OS X v10.5, the FSEvents API notifies your application when changes occur in the file system. You can use file system events to monitor directories for any changes, such as the creation, modification, or removal of contained files and directories. Although kqueues provide similar behavior, the FSEvents API provides a much simpler way to monitor many directories at once. For example, you can use file system events to monitor entire file system hierarchies rooted at a specific directory and still receive notifications about individual directories in the hierarchy. The implementation of file system events is lightweight and efficient, providing built-in coalescing when multiple changes occur within a short period of time to one or many directories.

The FSEvents API is not intended for detecting fine-grained changes to individual files. You would not use this to detect changes to an individual file as in a virus checker program. Instead, you might use FSEvents to detect general changes to a file hierarchy. For example, you might use this technology in backup software to detect what files changed. You might also use it to monitor a set of data files your application uses, but which can be modified by other applications as well.

For information on how to use the FSEvents API, see File System Events Programming Guide.


Ars.technica has more:
http://arstechnica.com/reviews/os/mac-os-x-10-5.ars/7
 

app


Joined
Apr 12, 2010
Messages
1
Reaction score
0
Points
1
how to access fsevents to capture file events?

Has any body access fsevents to capture file system changes/events.
Can anyone suggest some idea to access fsevents.

thanks in advance
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top