views:

43

answers:

1

I am working on an jail broken iphone app that calls a shell command. To read the output I redirect the output of the command to file. That is where my problem lies. When I attempt to do the redirect sh reports that the operation is not permitted.this is the exact output of gdb: sh: ./tmp/tmp.out: Operation not permitted Also I call my command using the system() function. thank you in advance

+1  A: 

You might instead want to use NSTask which is built for these sorts of things.

cobbal
to the best of my knowledge nstask is not apart of the cocoa touch library any other ideas?
romejoe
@romejoe It's there (I checked), not documented though
cobbal
ok what header or framework file do I have to import in order to access it? also is nstask available in all firmware versions?
romejoe
@romejoe I would try copying `NSTask.h` from `Foundation.framework` for Mac. You shouldn't have to link against anything extra. I would imagine it's available on all firmwares, but I can only confirm iOS 4.
cobbal
thank you this works after im done testing ill reply with if nstask works on all firmwares
romejoe