问题
I need to know in python whenever a new file was added/removed/modified in a particular directory Is there a way for that? I'm looking for an "inofity"-like function (from POSIX).
Thanks
回答1:
Use inotify-tools (In the original version, I mentioned pyinotify, but it had issues, and now is deprecated and not recommended).
回答2:
You can use inotify for python, which is NOT the same as PyInotify (older).
回答3:
As mentioned in the similar question, you might want to have a look at http://packages.python.org/watchdog/ which also works on Windows.
来源:https://stackoverflow.com/questions/12582720/how-to-check-in-python-that-a-file-in-a-folder-has-changed