commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject Re: [VFS] FileChangeEvent, inotify, and file changes outside JVM
Date Thu, 05 May 2005 15:39:29 GMT
>I'm looking at Commons VFS project and see FileChangeEvent.  I'm
>wondering if this lets an application listen for file/directory change
>events that happen outside of the JVM (e.g. a user deletes a file,
>edits it, or creates a new one, or perhaps creates a new directory)?
>I suspect the answer is no.... but perhaps somebody did some magic. :)
Have a look at DefaultFileMonitor.
The magic it does is to regulary scan the directories/files and fires 
some events if it detect changes.

Well, this is not far as good as inotify et al, but if you simply have 
to check a directory about new files you have to process then it could 
safe a lot of work for you.
>Also, I am wondering if anyone is looking into inotify and will be
>building something to let Java listen for inotify events under Linux. 
>This would be suuuuuuuuuuuper useful!
I have to admit I was only aware of dnotify, inotify is new to me.
How usefull this could be for VFS needs to be discussed. VFS trys to 
combine many various filesystems and such a daemon do only work with 
local files.
So the first home for this implementation could be commons-io.

>Does anyone know if there is a Java piece that listens to
>file/directory change events under Windows or Mac?
Windows allows a api for this, so you could use JNI to register to it.
Sorry I dont know a ready made java-api for this. Intellij IDEA do 
something like this to monitor filesystem changes.

I dont know what the Mac provides in this area.


View raw message