Here’s a simple Python program that monitors local files or directories for changes like creation, modification, and deletion. It uses the watchdog library, which is a popular and easy-to-use tool for file system monitoring.
How to use:
-
Install watchdog if you haven’t already:
-
Change the
pathvariable in the script to the directory you want to monitor. -
Run the script. It will print changes happening in the monitored folder and its subfolders.
This program continuously runs until you stop it (Ctrl+C), and reports on file creation, modification, deletion, and moving events.
Share this Page your favorite way: Click any app below to share.