seb-m/pyinotify — pull request #42 by quiver (2012-08-27 13:29:36+00:00)
Title: add support for IN_EXCL_UNLINK flag

IN_EXCL_UNLINK was added from kernel 2.6.36 but it's missing from the library.
If IN_EXCL_UNLINK flag is enabled, events are not generated for children after they have been unlinked.

# simple usage

Imagine, while you're writing to a file, that file is unlinked.
```
$ mkdir /tmp/dir
$ cat > /tmp/dir/aaa
test
# another terminal $ unlink /tmp/dir/aaa
test
Type Control-D
```

If you're watching /tmp/dir, following events are triggered :

```
$ python pyinotify.py --events-list ALL_EVENTS /tmp/dir/
# $ cat > /tmp/dir/aaa

```

If IN_EXCL_UNLINK flag is enabled, the last two events(events after unlinking) are not triggered:
```
$ python pyinotify.py --events-list ALL_EVENTS,IN_EXCL_UNLINK /tmp/dir/

# $ cat > /tmp/dir/aaa

# no further events are triggered for /tmp/dir/aaa
```