On May 11, 2008, at 13:25, Finlay Dobbie wrote:

On Sat, May 10, 2008 at 10:45 PM, Torsten Curdt <[EMAIL PROTECTED]> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to