Cocoa provides NSTask to run subprocesses. It can be used to run shell scripts, but all this manual pipe and file handling is a bit cumbersome. Fortunately, for a simple script, we can use the trusty old system and redirect its result to a file.
- // We'll save the result in a temp file
- // Run the shell script
- system([script UTF8String]);
- // Returns path to last crash report or empty string ( [lastCrash length == 0] )
You need to login to post a comment.