[launchd-dev] WatchPaths Indicator of triggering path?

Benjamin Burke benjaminburke at me.com
Tue Aug 12 23:36:34 PDT 2008


Hi,

When an agent is run as the result of a watched path being modified,  
does launchd provide the agent with the path that triggered it? For  
example, imagine that I have the following plist which identifies 3  
watchpaths:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd 
">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.example.test</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Users/tester/patchWatcher.pl</string>
	</array>
	<key>WatchPaths</key>
	<array>
		<string>/some/path</string>
		<string>/return/of/the/path</string>
		<string>/revenge/of/path</string>
	</array>
</dict>
</plist>

Is there some way that launchd tells my program which of the 3 watch  
paths triggered the event? Is there some hidden "%s" program argument  
or something like that. I checked the environment variables and didn't  
see anything. I checked the man pages and couldn't find anything.

Second, hopefully easier question: Do the terms "launch services" and  
"launchd" refer to the same thing?

Thanks,
Ben Burke



More information about the launchd-dev mailing list