Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Linux - issue with symlinks #109

Merged
merged 1 commit into from

3 participants

@vorwrath

Under linux with inotify, Watchdog currently sees symlinks to directories as traversable and can report changes on either the link or the original. It should work like rsync and most other utilities, where the normal behaviour is to treat the link as just a symlink file - changes should only be reported on them if something changes about the symlink itself (e.g. it is deleted or changes target) rather than changes to the linked files.

@ncw

Nice one. +1 from me

@gorakhargosh gorakhargosh merged commit b169c14 into gorakhargosh:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 18, 2012
  1. @vorwrath

    Fix traversal of symlinks

    vorwrath authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  src/watchdog/observers/inotify.py
View
3  src/watchdog/observers/inotify.py
@@ -238,6 +238,7 @@ class InotifyConstants(object):
InotifyConstants.IN_CREATE,
InotifyConstants.IN_DELETE,
InotifyConstants.IN_DELETE_SELF,
+ InotifyConstants.IN_DONT_FOLLOW,
])
class InotifyEvent(object):
@@ -627,6 +628,8 @@ def _add_dir_watch(self, path, recursive, mask):
for root, dirnames, _ in os.walk(path):
for dirname in dirnames:
full_path = absolute_path(os.path.join(root, dirname))
+ if os.path.islink(full_path):
+ continue
self._add_watch(full_path, mask)
def _add_watch(self, path, mask):
Something went wrong with that request. Please try again.