Why isn't Pyinotify able to watch a dir?
I would like Pyinotify to watch a templates directory, which has subfolders, but I'm getting this error:
DIRECTORY /home/project/templates
[Pyinotify ERROR] add_watch: cannot watch /home/project/templates WD=-1
[Pyinotify ERROR] add_watch: cannot watch /home/project/templates/dir1 WD=-1
开发者_如何学JAVA[Pyinotify ERROR] add_watch: cannot watch /home/project/templates/dir2 WD=-1
Waiting for stuff to happen...
I've found answers such as using a unicode directory name or using other programs which use inotify, but each is too specific.
What generally causes this error?
Increase the maximum number or watches:
sudo sysctl -n -w fs.inotify.max_user_watches=16384
Reference: http://github.com/seb-m/pyinotify/wiki/Frequently-Asked-Questions
ASIDE
If you're looking for notification tools, also try http://github.com/peterbe/python-gorun.
精彩评论