Skip navigation.
 
mlRe: gathering system information
FROM : Torsten Curdt
DATE : Sun May 11 17:38:06 2008

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

> On Sat, May 10, 2008 at 10:45 PM, Torsten Curdt <<email_removed>> 
> 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

Related mailsAuthorDate
mlgathering system information Torsten Curdt May 10, 17:28
mlRe: gathering system information Chilton Webb May 10, 18:12
mlRe: gathering system information Jens Alfke May 10, 20:27
mlRe: gathering system information Torsten Curdt May 10, 23:44
mlRe: gathering system information Torsten Curdt May 10, 23:45
mlRe: gathering system information Chris Hanson May 11, 03:55
mlRe: gathering system information Jens Alfke May 11, 06:33
mlRe: gathering system information Torsten Curdt May 11, 17:38