objective c - Running external programs in a sandboxed app -


How do I create an app to show all users logged in to the computer using the w command in the terminal?

I have made a beta app but it is disabling sandboxing [it shows to users] but it is not working with sandboxing [this is the case that there are no user login] code :

  NSTask * task = [NSTask new]; [Task set lockpath: @ "/ usr / bin / w"]; NSPipe * Output = [NSPipe pipe]; [Work setstandard input: [nspipe pipe]]; [Set output standard output: output]; [Launch the task]; NSFileHandle * Read = [Output filehousingFororing]; NSDTA * Datard = [ReadTataOfFile]; NSString * Result = [[NSString alloc] initWithData: data read encoding: NSUTF8StringEncoding]; [TV view set string: result];    

The utility to be used ( w >) Trying to access a file that is outside the sandbox. In essence, this will not work when launched from the sandboxed application.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -