Comments (3)
This can be expected as https://github.com/dsoprea/PyInotify#notes. The sample code is creating the directory in the same single thread/CPU, then InotifyTree can miss the timing.
IMPORTANT:
Recursively monitoring paths is not a functionality provided by the kernel.
Rather, we artificially implement it. As directory-created events are received,
we create watches for the child directories on-the-fly.
This means that there is potential for a race condition:
if a directory is created and a file or directory is created inside before you
(using the event_gen() loop) have a chance to observe it, then you are going to
have a problem: If it is a file, then you will miss the events related to its
creation, but, if it is a directory, then not only will you miss those creation
events but this library will also miss them and not be able to add a watch for them.
from pyinotify.
This is also a problem if the directory is created with a mkdir -p
which also create parent directories. Only the first new parent in the tree is noticed.
ie: if /a/b
is being watched and mkdir -p /a/b/c/d/e
is run only the contents of /a/b/c
will be added to the watch. Any subsequent events in /a/b/c/d
or /a/b/c/d/e
will not be captured.
This should be an easy fix. When a dir is added, check if it has subdirs and add them.
from pyinotify.
I'm not good enough with python to provide a PR, but it seems to me that the add-watch should be calling the __load_trees
but that's in another class.
from pyinotify.
Related Issues (20)
- Provide test.sh within release tarballs
- Exception during shutdown because of __del__ HOT 2
- Feature: add timestamp to events.
- Feature: InotifyTree depth, or path mask
- [Improvement] Adapters: Remove duplicate code
- Question about fd monitoring
- Add support for watching a single file HOT 3
- pytest Failed under CentOS7/Python3.8 HOT 1
- `superficial` parameter not forwarded to remove_watch_with_id() HOT 1
- Does this project have any active maintainers? HOT 3
- Create Dockerfile to support unit-test debugging/development from local and fix current CI issues
- Issue running with socketio HOT 1
- Package seems to be broken HOT 2
- AttributeError: 'Inotify' object has no attribute '_Inotify__inotify_fd' HOT 1
- Problem in SunOS/Solaris
- test.sh fails
- Release a new version with recent fixes?
- Moves are not handled properly HOT 2
- Superficial remove prevents later remove
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyinotify.