I want to monitor a folder located on another computer using the FileSystemWatcher.
How can i do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Suppose, your computer A wants to observe a directory on the hard drive of computer B. Here are some ways to achieve this:
Have computer A mount the remote file system on B using SMB, NFS or some other network file system protocol. Then your application running on A should be able to:
use a Java 7 WatchService to get file system events on the directory,
in Java 6 and earlier, poll the directory’s modification date etc to see when it changes, or
use a native program or library to read Linux
inotify(7)events or the Windows equivalent.If you can’t mount B’s file system on A, you need to implement and run some kind of remote service on B that can be queried by a client application running on A. There are many possible ways to do this.