windows - python: how to track new directory creation in a directory with subdirectories -
i want write python script (and run 24/7 on windows 7 in background) checking if new directory created in c:\data\ or in subdirectories of c:\data (e.g. c:\data\1\2\3\ or c:\data\1\test\2)
what performant way (on windows 7) track directory creation?
use pywin32 hook windows api. use 1 of change notifications changes occur. painful in python, performant way monitor directory changes. note works on local file systems, not network file systems.
your other option check , sleep, full of fun little surprises , edge cases. favorite windows writes file pointers before writes file contents. given enough time, "find" file before exists, , code fail. , cannot wait fixed time after see it, since might not done writing.
network writes of several hundred meg files anyone?
Comments
Post a Comment