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




On 12-Jan-06, at 5:07 PM, Greg Guerin wrote:


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.

For the record on Windows NTFS filesystems usually DO change the dir's mod-date when a file is added/deleted. BUT it can be turned off (for performance reasons) with a registry setting. The FAT/FAT32 filesystems do NOT change the dir's mod-date. Thus making the pure Java approach rather difficult to get consistent results from.


I'm hoping the Java Desktop Integration Components project at Java.net (https://jdic.dev.java.net) will come up with a good set of bindings to the appropriate native APIs where available.

Scott
_______________________________________________
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: Notification of filesystem changes (From: Greg Guerin <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.