I am using the Python watchdog module on a Windows 2012 server to monitor new files appearing on a shared drive. When watchdog notices the new file it kicks off a database resto
In your on_modified event, just wait until the file is finished being copied, via watching the filesize.
Offering a Simpler Loop:
historicalSize = -1 while (historicalSize != os.path.getsize(filename)): historicalSize = os.path.getsize(filename) time.sleep(1) print "file copy has now finished"