summaryrefslogtreecommitdiff
path: root/python3
diff options
context:
space:
mode:
authorSebastien Martini <seb@dbzteam.org>2012-03-11 21:41:04 +0100
committerSebastien Martini <seb@dbzteam.org>2012-03-11 21:41:04 +0100
commitf3f89a6266186433b4869e603153396829ce6671 (patch)
tree8679fb61d1bc89517121bc8d5d96088955ee3e75 /python3
parent98c5f41a6e2e90827a63ff1b878596f4080481cc (diff)
downloadpyinotify-f3f89a6266186433b4869e603153396829ce6671.tar.gz
auto_add=True automatically implies oring IN_CREATE with the
provided mask value. Misbehavior reported by Maxime Augier https://github.com/maugier.
Diffstat (limited to 'python3')
-rwxr-xr-xpython3/pyinotify.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python3/pyinotify.py b/python3/pyinotify.py
index 5194255..91cf532 100755
--- a/python3/pyinotify.py
+++ b/python3/pyinotify.py
@@ -1746,6 +1746,8 @@ class WatchManager:
watch manager dictionary. Return the wd value.
"""
path = self.__format_path(path)
+ if auto_add and not mask & IN_CREATE:
+ mask |= IN_CREATE
wd = self._inotify_wrapper.inotify_add_watch(self._fd, path, mask)
if wd < 0:
return wd
@@ -1788,6 +1790,8 @@ class WatchManager:
@type rec: bool
@param auto_add: Automatically add watches on newly created
directories in watched parent |path| directory.
+ If |auto_add| is True, IN_CREATE is ored with |mask|
+ when the watch is added.
@type auto_add: bool
@param do_glob: Do globbing on pathname (see standard globbing
module for more informations).
@@ -1901,8 +1905,9 @@ class WatchManager:
subdirectories contained into |wd| directory.
@type rec: bool
@param auto_add: Automatically adds watches on newly created
- directories in the watch's path corresponding to
- |wd|.
+ directories in the watch's path corresponding to |wd|.
+ If |auto_add| is True, IN_CREATE is ored with |mask|
+ when the watch is updated.
@type auto_add: bool
@param quiet: If False raises a WatchManagerError exception on
error. See example not_quiet.py