views:

47

answers:

1

Hi:

For executing a shell command I'm using system("ls"); command. Is there any way I can read the output?

+1  A: 

You can't do this on the iPhone since there is no shell. On a standard POSIX system (like OS X on the desktop) you would either use popen, or set up a pipe between your app and the child process manually using fork, exec, and pipe.

If you actually want to list the contents of a directory, use NSFileManager.

orange