For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > July 2004 > Monitor filesystem for changes? Tried Netbeans Filesystems API but no luck...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Monitor filesystem for changes? Tried Netbeans Filesystems API but no luck...
J Wilks

2004-06-11, 8:56 pm

Anyone know of a good piece of code to monitor a filesystem for changes? I
would like to be able to pass it a file or directory handle and receive
notification when the file is changed, a file is created/renamed/deleted
within the directory, etc. Ideally, if given a directory it would monitor
recursively (reporting changes in subdirectories as well).

I tried the Netbeans Filesystems API:
http://openide.netbeans.org/fs/Library.html

However, it does not seem to detect changes made externally. In other words,
if I monitor a directory within my java app, but add a file to the directory
from outside the java app, it doesn't raise an event for that. If someone is
familiar with

I realize that catching OS filesystem events involves native code, but I'm
okay even just with code that just polls the directory for changes, as long
as I can set the interval.


filip_hoeven

2004-07-14, 1:56 pm

Any luck?

I'm also searching for this. Both options are OK, but I prefer a (native) implementation that doesn't require polling.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com