Note that there are some explanatory texts on larger screens.

plurals
  1. POWatchdog (osx) not notifying on remote network changes
    primarykey
    data
    text
    <p>I'm using <a href="http://packages.python.org/watchdog/" rel="noreferrer">Watchdog</a> to monitor a network directory, non-recursive, for a specific pattern of files to be created over time. The issue I am seeing is that while it works fantastic when I test locally, if I make changes to the monitored directory from a remote machine, the events are not triggered.</p> <p>Here are the specific details of my configuration:</p> <ul> <li>OSX</li> <li>monitoring a single directory, non-recursive, on an NFS mount</li> <li>python 2.6</li> </ul> <p>An example of my problem can be easily reproduced by using the stock example snippet:</p> <pre><code>import sys import time import logging from watchdog.observers import Observer from watchdog.events import LoggingEventHandler if __name__ == "__main__": logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S') event_handler = LoggingEventHandler() observer = Observer() observer.schedule(event_handler, path=sys.argv[1], recursive=False) observer.start() try: while True: time.sleep(1) except KeyboardInterrupt: observer.stop() observer.join() </code></pre> <p>If you start this on a network directory, and then make changes from the same system, the events are dispatched. But if you then make changes to the directory from another machine on the network, no events are dispatched.</p> <p>Am I missing something regarding limitations of kqueue (or could be FSEvents on OSX, since it says its preferred first by Watchdog)?</p> <p>I was stoked on this python package, and was going to start using it for other scripts to replace filesystem polling, but I can't seem to find any information regarding why I am seeing this issue.</p> <p><strong>Update</strong></p> <p>I also tested <a href="http://pypi.python.org/pypi/MacFSEvents" rel="noreferrer">MacFSEvents</a> and got the same problem. Then I modified the above test script to forcibly try different observers:</p> <pre><code># does not work with remote changes from watchdog.observers.fsevents import FSEventsObserver as Observer # does not work with remote changes from watchdog.observers.kqueue import KqueueObserver as Observer # only option that works because its actually polling every second from watchdog.observers.polling import PollingObserver as Observer </code></pre> <p>So at least for now, I can use the polling observer and not have to modify my code, until someone can shed some light on the real problem I am having.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload