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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -