• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: gathering system information
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >gathering system information (From: Torsten Curdt <email@hidden>)
 >Re: gathering system information (From: Jens Alfke <email@hidden>)
 >Re: gathering system information (From: Torsten Curdt <email@hidden>)

  • Prev by Date: Re: Core Data: How to Observe "dirty" State?
  • Next by Date: Update slider position
  • Previous by thread: Re: gathering system information
  • Next by thread: Re: gathering system information
  • Index(es):
    • Date
    • Thread