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
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 mails | Author | Date |
|---|---|---|
| Torsten Curdt | May 10, 17:28 | |
| Chilton Webb | May 10, 18:12 | |
| Jens Alfke | May 10, 20:27 | |
| Torsten Curdt | May 10, 23:44 | |
| Torsten Curdt | May 10, 23:45 | |
| Chris Hanson | May 11, 03:55 | |
| Jens Alfke | May 11, 06:33 | |
| Torsten Curdt | May 11, 17:38 |






Cocoa mail archive

