Re: gathering system information
Re: gathering system information
- Subject: Re: gathering system information
- From: Torsten Curdt <email@hidden>
- Date: Sun, 11 May 2008 17:38:06 +0200
On May 11, 2008, at 13:25, Finlay Dobbie wrote:
On Sat, May 10, 2008 at 10:45 PM, Torsten Curdt <email@hidden>
wrote:
Note that you don't have to make system_profiler write to a file.
You can
call it with NSTask, attach an NSPipe to its stdout, and read that
with an
NSFileHandle
Ah ...that's a good idea. But how would I init the NSDictionary
from it?
There are only
dictionaryWithContentsOfFile:
dictionaryWithContentsOfURL:
that do parsing. Or am I missing something?
The NSPropertyListSerialization class.
Ah!
NSData *output = [[outPipe fileHandleForReading] readDataToEndOfFile];
and then
propertyListFromData:mutabilityOption:format:errorDescription:
cheers
--
Torsten
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden