seb-m / pyinotify

Monitoring filesystems events with inotify on Linux.
http://github.com/seb-m/pyinotify/wiki
MIT License
2.29k stars 379 forks source link

Feature Request: Access the filename using the CLI #168

Open dagostinelli opened 5 years ago

dagostinelli commented 5 years ago

When using it like so:

./venv/bin/python3 -m pyinotify -r -a -e IN_CLOSE_WRITE -c 'echo $1' src/

I would like to retrieve the full path of the file changed.

It looks like this line of code is what needs to be enhanced:

    if options.command:
        def cb(s):
            subprocess.Popen(options.command, shell=True)
cb_fun = cb