Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

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 emeritus
Feb 5, 2004
2,240
504
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.