JNotify Mac OS support

Because of the way Mac OS X handles file change notifications, some things may work differently. If you are concerned about Mac support, you should be aware of the following:
  • Events are not guaranteed to be reported in order. Events should be reported within two seconds of occuring. Multiple events occuring within two seconds may be reported in any order.
  • File changes that are present less than two seconds may be missed. For example, mv a b && mv b c may report only a single rename.
  • The code that detects renames is only aware of files being watched. If a file outside the watched directory is moved into the directory, it will be reported as a create. Likewise, if a file is moved out of the watched directory, it will be reported as a delete.

The Mac OS X API for file system events only reports what directory changes have occured in, and has some latency in it. If you register a net.contentobjects.jnotify.macosx.FSEventListener with net.contentobjects.jnotify.macosx.JNotify_macosx, you'll receive a notifyChange event telling you when a directory has changed, within a second of the change occuring. The OS will merge changes together so you'll only get one notification per directory within one second, regardless of how many changes have occured. If too many changes occur in different subdirectories, the OS may merge them into a single event for a common parent directory, in which case the recurse flag will be set. See the FSEvents API for more details.