treewatcher
is a python module for watching which files are accessed and
modified while performing an operation. The target use is tracking dependencies
in an incremental build.
sudo python setup.py install
treewatcher
uses pyinotify to watch
files. This means:
treewatcher
will only run on Linuxtreewatcher
will only run on those versions of Linux on whichpyinotify
will run.
treewatcher
uses one function: run_watch_files
. Pass it the command to
run and the directory to watch. As an example:
from treewatcher import run_watch_files from subprocess import Popen def proc(): proc = Popen( ['touch', 'foo'], cwd = '.' ) proc.wait() _, mods = run_watch_files(proc, '.') print(mods)
Also see the docstring for the function run_watch_files
.