Automatically running a command whenever a file is savedlenni.info 7 pointslenni15 years ago4 commentsSaveHideCopy link On HNComments−mthomas15yI notice that you're using a polling thread keep track of modification times. I know that linux has inotify: http://github.com/seb-m/pyinotify and OsX has something similar with FSEvents: http://pypi.python.org/pypi/MacFSEvents−shabble15yI quite like http://search.cpan.org/~drolsky/File-ChangeNotify-0.17/lib/F... for perl. It's cross-platform (backends for linux, OSX/BSD and Win32 afaik), and is very straightforward to use.−lenniOP15yOh great, I looked around but haven't found anything like it.−zacharydanger15ySounds like incron. Which is just a cron-like interface for inotify.
Comments
I notice that you're using a polling thread keep track of modification times. I know that linux has inotify: http://github.com/seb-m/pyinotify and OsX has something similar with FSEvents: http://pypi.python.org/pypi/MacFSEvents
I quite like http://search.cpan.org/~drolsky/File-ChangeNotify-0.17/lib/F... for perl. It's cross-platform (backends for linux, OSX/BSD and Win32 afaik), and is very straightforward to use.
Oh great, I looked around but haven't found anything like it.
Sounds like incron. Which is just a cron-like interface for inotify.