https://win32com.goermezer.de/content/view/286/285/
This site is really a force, not much to say, the code directly to carry over, and my test results, take away!
ImportOSImportSYSImportWin32fileImportwin32conactions= { 1:"Created", 2:"Deleted", 3:"Updated", 4:"Renamed from Something", 5:"Renamed to something"}file_list_directory= 0x0001Path_to_watch='e:/test'Print 'watching changes in', Path_to_watchhdir=Win32file. CreateFile (Path_to_watch, File_list_directory, Win32con. File_share_read|Win32con. File_share_write, None, Win32con. Open_existing, Win32con. File_flag_backup_semantics, None) while1: Results=Win32file. READDIRECTORYCHANGESW (Hdir,1024, True, Win32con. File_notify_change_file_name|Win32con. File_notify_change_dir_name|Win32con. File_notify_change_attributes|Win32con. File_notify_change_size|Win32con. File_notify_change_last_write|Win32con. File_notify_change_security, none, none) forAction, filenameinchResults:full_filename=os.path.join (path_to_watch, filename)PrintFull_filename, Actions.get (action,"Unknown")
Operation Result:
To this step, the back can be done more, can write log, do statistics, warning, too cool!
Handling: Python for windows--monitoring changes to files in a Windows directory