Monitoring file / directory contents?

Am I looking for a cross-platform package for monitoring python files? I know that it is possible to control files on windows using pywin32, and there are packages that work on Linux / Unix, but does anyone know about cross-platform?

+50
python file filesystems cross-platform monitoring
Feb 28 '09 at 11:42
source share
5 answers

For Unix / Linux-based systems, you should use the File Alteration Monitor Python libfam bindings .

For Windows-based systems, you must bind the Win32 FindFirstChangeNotification API and related functions.

As for the cross-platform method, I do not know about a good cross-platform method. I think it would be best to create a module on its own that works on any OS that uses one of the two methods described above after finding which OS it is.

+29
Feb 28 '09 at 12:27
source share
— -

I am working on a licensed MIT license that helps Python programs track file system events as mobile as possible. There are differences that I am trying to smooth out. High alpha version at the moment:

Check here: http://github.com/gorakhargosh/watchdog/

Patches and contributions are welcome.

Hope this helps. Greetings equal sign.

+83
Nov 19 2018-10-19
source share

Also check this option:

http://pypi.python.org/pypi/watchdog

Used with a cross-platform application on Windows and OS X.

+4
Sep 06 '11 at 3:50
source share

I found this link that talks about your problem. Although this does not actually provide an s / library solution, I think this will help. http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html

I don't think there is cross-platform, but you might want to roll yourself.

I am inexperienced in this area, so I am not sure. Hope this helps.

Note
I correct, gamin is available on cygwin, as Adam Bernier noted to me in a comment. You can explore other cygwin options (if they exist).

+2
Feb 28 '09 at 11:55
source share

The easiest way on Linux is to use inotifywait (given that your kernel is fairly recent). You do not need special bindings, inotifywait can be configured to print output strings on standard output in any way. See this question for a good example.

0
May 14 '09 at 13:46
source share



All Articles