Launchd execute command when folder contents modified or changed
For the past two days i've been trying to get a launchd plist to execute a script "program" when the contents of a folder on my desktop contents have modified or changed. I've gone through tons of configuration settings and have tried the Users/me/Desktop/folderinquestion
and Users/me/Desktop/folderinquestion
(with and without trailing slash).
The script executes only when something is added or removed but it doesn't recognize when files are updated and subdirectories. launchd is really my last hope to getting this to working i've already exausted folder actions, and bash scripts, uninstallable linux methods etc.
I have used Lingon to create my plists and have followed this youtube tutorial. Any help would be greatly appreciated.
This is what I have right now, and like I said does not work when folder is modified or changed
IDEA:
Thinking about creating two separate plists that reference each other one plist can watch a folder for additions and subtractions and when one occurs it can create another plist that watches every file in the folder, this could also be recursive and count in for subdirectories.
I don't think launchd
supports that level of monitoring; you can watch individual files or you can watch for additions to a directory, but you can't do full inotify
/fam
/gamin
-style watching of an entire directory tree. You would need to run as a standalone daemon and use either BSD kqueue
or Mach ports (or use fam
or gamin
to do it for you) to monitor your tree.