Skip to content

Commit

Permalink
BF: pyinotify - use bitwise op on masks and do not try tracking newly…
Browse files Browse the repository at this point in the history
… created directories
  • Loading branch information
yarikoptic committed Jan 25, 2013
1 parent b8a861d commit 6b2e76b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/filterpyinotify.py
Expand Up @@ -65,7 +65,11 @@ def __init__(self, jail):

def callback(self, event):
path = event.pathname
if event.mask == pyinotify.IN_CREATE:
if event.mask & pyinotify.IN_CREATE:
# skip directories altogether
if event.mask & pyinotify.IN_ISDIR:
logSys.debug("Ignoring creation of directory %s" % path)
return
# check if that is a file we care about
if not path in self.__watches:
logSys.debug("Ignoring creation of %s we do not monitor" % path)
Expand Down

0 comments on commit 6b2e76b

Please sign in to comment.