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: Notification of filesystem changes



Paul J. Lucas wrote:

>Hearing all the options would be nice.

On Mac OS X:
  a) Use the fslogger command (google 'fslogger'; requires 10.4+).
  b) Write JNI code for FNNotify/FNSubscribe API
    <http://www.cocoadev.com/index.pl?FileSystemNotifications>
  c) See if NSWorkspace's methods work (Cocoa-Java).
  d) Use platform-neutral Java code.

On W/XP:
  a) Write native code.  I dunno what API.  Ask on a Windows list.
  b) Use platform-neutral Java code.

Plaform-neutral Java:
  Write a class that periodically checks a dir's mod-date, and sends an
event to registered listeners.  Also write a class in the same pattern that
periodically does a File.listRoots() and sends an event on changes (needed
for Windows, not for Mac OS X).
  Upside:
    simple strategy
  Downside:
    requires that changes (add, del, rename) actually affect dir's mod-date.
    hits FS regularly (mitigated by FS caching)
    may degrade if watching lots of files at once, or recursively
    etc.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to 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.