watchdog icon indicating copy to clipboard operation
watchdog copied to clipboard

Doesn't work on FreeBSD

Open telzhov opened this issue 3 years ago • 1 comments

Tried to run the following code (wd.py) on Linux and FreeBSD 12:

import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler

class Handler(PatternMatchingEventHandler):
    def on_any_event(self, ev):
        print(f'{ev.event_type} {ev.src_path}')

if __name__ == '__main__':
    observer = Observer()
    observer.schedule(Handler(), '.')
    observer.start()

    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        observer.stop()

    observer.join()

Then, created a file, moved it, and deleted:

touch xx
mv xx yy
rm yy

On a Linux script responded exactly what was expected:

created ./xx
modified ./xx
closed ./xx

moved ./xx

deleted ./yy

But of FreeBSD its logging looks a bit weird:

created ./xx

created /usr/home/monitoring/xx
deleted /usr/home/monitoring/xx

The first response ('created ./xx') is correct yet incomplete -- it lacks notifications about modifying and closing file; the second is, well, wrong (I certainly couldn't create xx by calling mv xx yy). Finally, It didn't response to 'rm yy' at all.

This is what uname -r says for my FreeBSD, in case you find it helpful:

12.2-RELEASE-p4

So I'm wondering, is FreeBSD currently supported, or are there any plans to support it?

Thank you for your nice and very useful package anyway!

telzhov avatar Oct 19 '21 08:10 telzhov

+1ing this here, I was wondering if it doesn't work because of my nullfs mount, or because the module's broken.

karolyi avatar Sep 25 '23 15:09 karolyi