pyinotify

Which process was responsible for an event signalled by inotify?

I am using pyinotify to detect access, changes, etc. on files in a given directory. Is there an easier way to find out which process was responsible for that - without having to patch inotify? ...

pyinotify.ThreadedNotifier, process_* not called

Hi I have a problem with pyinotify: the methods process_*() of the ProcessEvent are not called The code import sys, time, syslog from pyinotify import WatchManager, Notifier, ThreadedNotifier, ProcessEvent, EventsCodes from daemon import Daemon class PTmp(ProcessEvent): def process_IN_CREATE(self, event): syslog.syslog("cre...

Slow pyinotify.ThreadedNotifier.stop()

Hi all, I have a wxPython application that uses pyinotify (via ThreadedNotifier) to check when a certain file gets modified. When this happens, the application stops watching the file and does some stuff. Everything works fine, except that often the call to ThreadedNotifier.stop() takes a noticeable time, about 4 seconds... Other times, ...

pyInotify performance

I have a very large directory tree I am wanting pyInotify to watch. Is it better to have pyInotify watch the entire tree or is it better to have a number of watches reporting changes to specific files ? Thanks ...

pyinotify file deletion user

I'm trying to use pyinotify to alert me whenever files are deleted, but I want to know what user deleted the files. Is there a way to find this information? ...

Pyinotify doesn't run with pygtk

Hi everyone, I'm newbie in python and I'm trying to use pyinotify with a GUI interface using pygtk. I have two classes, my gtk class which doesn't do much, only displays stuff, and a class that handles the monitoring. When I run them separately they do their work but when I try to load the gtk class from the other one, it only runs the ...

which inotify event signals the completion of a large file operation?

for large files or slow connections, copying files may take some time. using pyinotify, i have been watching for the IN_CREATE event code. but this seems to occur at the start of a file transfer. i need to know when a file is completely copied - it aint much use if it's only half there. when a file transfer is finished and completed, w...

How to poll a file in /sys

Hi, I am stuck reading a file in /sys/ which contains the light intensity in Lux of the ambient light sensor on my Nokia N900 phone. See thread on talk.maemo.org here I tried to use pyinotify to poll the file but this looks some kind of wrong to me since the file is alway "process_IN_OPEN", "process_IN_ACCESS" and "process_IN_CLOSE_NOW...

pyinotify: Handling IN_MODIFY triggers

I am trying to watch a directory, and is looking for file modifications. Thinking of using pyinotify. Problem is that while using IN_MODIFY event to check for a file change, it triggers quite a number of events if I am copying even a small file of say 12 MB to the directory over a network. I dont want to handle so many triggers. I want ...

Dropbox and pyinotify

I just got an iPad and I foolishly got the TexTouch application. Foolishly, because due to Apple regulation, TexTouch can't compile Tex. It syncs the .tex file to a computer using Dropbox. On the distant computer, it gets caught by another program that compiles the .tex file to PDF and sends it back. But (surprise!) that distant program ...

Why isn't Pyinotify able to watch a dir?

I would like Pyinotify to watch a templates directory, which has subfolders, but I'm getting this error: DIRECTORY /home/project/templates [Pyinotify ERROR] add_watch: cannot watch /home/project/templates WD=-1 [Pyinotify ERROR] add_watch: cannot watch /home/project/templates/dir1 WD=-1 [Pyinotify ERROR] add_watch: cannot watch /home/p...

Success unit testing pyinotify?

I'm using pyinotify to mirror files from a source directory to a destination directory. My code seems to be working when I execute it manually, but I'm having trouble getting accurate unit test results. I think the problem boils down to this: I have to use ThreadedNotifier in my tests, otherwise they will just hang, waiting for manual...

Using pyinotify to watch for file creation, but waiting for it to be completely written to disk

I'm using pyinotify to watch a folder for when files are created in it. And when certain files are created I want to move them. The problem is that as soon as the file is created (obviously), my program tries to move it, even before it's completely written to disk. Is there a way to make pyinotify wait until a file is completely written...

pyinotify asyncnotifier thread question

I'm confused about how asyncnotifier works. What exactly is threaded in the notifier? Is the just the watcher threaded? Or does each of the callbacks to the handler functions run on its own thread? The documentation says essentially nothing about the specifics of the class. ...