Mac Accessing Terminal From Cocoa?

DavidCar

macrumors 6502a
Original poster
Jan 19, 2004
525
0
I want to try monitoring some system statistics from a cocoa program. I don't know much about Terminal, but I'm wondering if I can issue a terminal command from cocoa and get back a string as a response. Then I can scan the string for what I want.

If I knew where to start looking in the documentation I could go from there. Thanks.

DC
 

HexMonkey

Administrator
Staff member
Feb 5, 2004
2,161
433
New Zealand
Cocoa Dev Central has a couple of useful tutorials about this. The first is an example of writing a wrapper to the wget command. The second shows how to get the output of a command (in this case, the ls command).

You might also like to look at the documentation for NSTask and NSPipe.
 

DavidCar

macrumors 6502a
Original poster
Jan 19, 2004
525
0
HexMonkey said:
Cocoa Dev Central has a couple of useful tutorials about this. The first is an example of writing a wrapper to the wget command. The second shows how to get the output of a command (in this case, the ls command).

You might also like to look at the documentation for NSTask and NSPipe.
Excellent! It would have taken me a while to find those references.

Thanks.
DC
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.