tags:

views:

597

answers:

4

I need a good reference in how to get my hooks into Darwin. Basically I'd like to write an app the take care of some of the admin chores I do on my Macs. For example, moving new media to the backup server sorted by media type, pulling process info. Simple things like that. So basically I'd like to create a nifty GUI app that would call my shell scripts and give me the output of those scripts.

Is there anything equivilent to python's subprocess or C#'s Process library?

Links would suffice just fine.

Thanks.

+2  A: 

Will NSTask do?

frou
+1  A: 

You can use the system(3) function to have the shell execute a command line:

system("path/to/my/shellscript.sh");
Adam Rosenfield
+1  A: 

There's always the good old unix way to start processes: fork and execve

If you're planning to perform tasks that need administrator rights, you'll probably want to look into Authorization Services. The Security.framework is used to get authorization from the keychain and start (unix) processes with extended privileges.

Nikolai Ruhe