osx - How can I pass the name of the file that was changed in launchd? -
i trying watch directory changes via launchd. plist file looks this:
<key>programarguments</key> <array> <string>/users/myname/bin/boink</string> <string>path modified</string> </array> all works ok, pass name of file changed argument script /users/myname/bin/boink
is possible? man page isn't helpful, nor did googling lot.
thanks.
the short answer is: no. launchd(8) uses kqueue (http://en.wikipedia.org/wiki/kqueue) receive kind of notification. unfortunately kqueue(2) not return which item has triggered event.
you may want use launchd(8) key queuedirectories instead. works same way watchpaths works, assumes processing agent/daemon moving processed items directory being monitored one. whenever event triggered job can process every file in monitored directory. make sure move them after processing.
Comments
Post a Comment