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: file system events



Hi Glen-

Thanks for getting back to me. The folks at http://www.jniwrapper.com are working on an implementation for this, but their OS X code is in beta, and I prefer to use open source solutions whenever possible. Somewhere down the line, it's mostly platform dependent stuff until someone writes a cross-platform (for example Java) implementation. The whole NIO package comes to mind.

I'm trying to avoid the thread that just checks modification times because it's so ugly, but that's what I'll do if I don't find any OS X library out there that does this. If I had the time, I'd write the native code myself, but that'll have to wait.

-Adam


Glen Fisher wrote:

Adam Fisk wrote:
| Does anyone know of an open source, cross platform library for receiving
| file system events in Java?  I noticed your POSIX library, Greg.  Does
| it generate an event when, for example, a file is added to a directory
| or when a file in a watched directory is changed?  I also need a Windows
| implementation, but if your POSIX stuff responds to those events on OSX,
| I can probably figure something else out for Windows.

I wouldn't count on any such library existing. What you're asking for is
*strongly* platform-dependent. Some OSes don't even provide such
notifications. (The POSIX standard doesn't appear to include "file system
notifications" in its feature set.)

The cross-platform solution is to start a thread going that checks the
relevant file or directory every so often to see whether it's changed.

Glen Fisher

_______________________________________________
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



_______________________________________________
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
References: 
 >Re: file system events (From: Glen Fisher <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.