title: Using watchdog of python to monitoring afp shared folder from linux
body: <p>I want linux machine(Raspberry pi) to monitor a shared folder by AFP(Apple file protocol, macbook is host).</p>
  
  <p>I can mount shared folder by mount_afp, and installed watchdog python library to monitor a shared folder. The problem is that watchdog can monitor only modifications from linux machine itself.</p>
  
  <p>If a monitoring folder has been modified by the host machine(Apple macbook) or other pc, linux machine couldn't find out the change. No logs came out.</p>
  
  <p>After I tested the same watchdog python file in host machine(Apple macbook), I can get every logs of modifications by other machine.</p>
  
  <p>Host machine can get every modifications of file or folder. But other machine(guest machine) can not monitor modifications of file from host or others.</p>
  
  <p>Is it normal status of watchdog? Or is there any problem in account and permission?</p>
  
  <p>Here is watchdog sample.</p>
  
  <pre><code>  import time
  from watchdog.observers import Observer
  from watchdog.events import FileSystemEventHandler
  
  
  class Watcher:
      DIRECTORY_TO_WATCH = "/path/to/my/directory"
  
      def __init__(self):
          self.observer = Observer()
  
      def run(self):
          event_handler = Handler()
          self.observer.schedule(event_handler, self.DIRECTORY_TO_WATCH, recursive=True)
          self.observer.start()
          try:
              while True:
                  time.sleep(5)
          except:
              self.observer.stop()
              print "Error"
  
          self.observer.join()
  
  
  class Handler(FileSystemEventHandler):
  
      @staticmethod
      def on_any_event(event):
          if event.is_directory:
              return None
  
          elif event.event_type == 'created':
              # Take any action here when a file is first created.
              print "Received created event - %s." % event.src_path
  
          elif event.event_type == 'modified':
              # Taken any action here when a file is modified.
              print "Received modified event - %s." % event.src_path
  
  
  if __name__ == '__main__':
      w = Watcher()
      w.run()
  </code></pre>