Much like a similar SO question, I am trying to monitor a directory on a Linux box for the addition of new files and would like to immediately process these new files when they arrive. Any ideas on the best way to implement this?
Track Events with Event Viewer To monitor changes to a folder, you need to open the Event Viewer. In Windows search box, type “Event Viewer” and open the tool from the result. Go to “Windows Logs” and then “Security”. This will open a list of the recent activities on the middle panel.
Type the path to the folder that you are monitoring. You can use the ellipsis (...) button to browse for the folder. Select this option to monitor the files and folders in sub-folders in the Folder that you specified.
To test how fswatch works, open two Terminal windows (Let us call them Terminal 1 and Terminal 2). In Terminal 1, run the fswatch command to monitor the $HOME directory.
# find the path to the desktop folder: $desktop = [Environment]::GetFolderPath('Desktop' # specify the path to the folder you want to monitor: $Path = $desktop # specify which files you want to monitor $FileFilter = '*' # specify whether you want to monitor subfolders as well: $IncludeSubfolders = $true # specify the ...
Look at inotify.
With inotify you can watch a directory for file creation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With