- Copy and update the script: 'demo.file.watcher.exe' (keep the two parameters [kind] and [file])
script update "demo.file.watcher.exe" false 1
(param
(var "[kind]" {true} "The kind" is_null:true is_empty:true "")
(var "[file]" {true} "The file" is_null:true is_empty:true "")
;)
"description ..."
{
log trace (concat "[kind]=" [kind] ", [file]=" [file]);
} "Return ...";
- Create a file watcher on the script:
file_watcher start "fKey" "admin" "/Users/jimmitry/Desktop/dir" "demo.file.watcher.exe";
"2023-08-07 09:16:46.300+0400: Begin FileWatcher: fKey";
- Update the directory (add file for example) and get log trace...
"2023-08-07 09:19:24.586+0400: [kind]=ENTRY_CREATE, [file]=I1.jpg";
- Kill the file watcher
file_watcher kill "fKey";
"2023-08-07 09:19:54.715+0400: End FileWatcher: fKey";