views:

173

answers:

1

I am trying to write a small Cocoa application that helps me manage my time, I want it check on startup if already has a launchd entry and if not, add itself an entry.

What is the correct folder to write the launchd file, and/or is there a special cocoa method to retrieve what the correct folder is (ie in the same way you retrieve the users document folder) or do you just assume one of the following hard coded locations?

The man pages list the following possible URL's I probably want to use ~/Library/LaunchAgents?

 ~/Library/LaunchAgents         Per-user agents provided by the user.
 /Library/LaunchAgents          Per-user agents provided by the administrator.
 /Library/LaunchDaemons         System-wide daemons provided by the administrator.
 /System/Library/LaunchAgents   Per-user agents provided by Mac OS X.
 /System/Library/LaunchDaemons  System-wide daemons provided by Mac OS X.
+3  A: 

You probably want ~/Library/LaunchAgents if your app will interact with the user. I'm not aware of a Cocoa method that will return this path for you.

There is a detailed tech note on agents and daemons that you should probably check out:

http://developer.apple.com/mac/library/technotes/tn2005/tn2083.html

Rob Keniger
"Agents and daemons" sounds like the title of a Dan Brown novel.
Alex
@Alex - their is some serious potential for parody there.
Abizern