I would like to invoke my chrome or firefox browser when a file that I specify is modified. How could I “watch” that file to do something when it gets modified?
Programmatically it seems the steps are.. basically set a never ending interval every second or so and cache the initial modification date, then compare the date every second, when it changes invoke X.
As noted, you can use pyinotify:
E.g.:
This is more efficient than polling. The kernel tells you when it does the operation, without you having to constantly ask.