Re: Machine information
Re: Machine information
On Wed, Sep 10, 2003 at 01:43:57PM -0400, Gregory Pelle wrote:
>
I have been searching the archives and have not found any pointers on
>
how to do the following.
>
>
I am wanting to access the machine information sort of like what the
>
Apple System Profiler does, but I also need to know the machine name
>
(network name of the machine).
>
>
Is there a framework that I can use to read this information? I am not
>
wanting to make any changes, just reading.
You can use NSTask to execute system_profiler, but be aware it
produces a -lot- of output (and takes a corresponding long time to
generate that output) in Jaguar. ASP was rewritten for Jaguar but I
guess Apple didn't have time to make the command-line equivalent any
good. system_profiler only showed up in one of the 10.2.x releases;
it wasn't in 10.2.
The AppleSystemProfiler tool in 10.1 is based on the same framework as
the older ASP GUI tool (Carbon, MacApp-based) and produces much less
verbose output, though it doesn't have an easily-parsable XML option
like system_profiler. DO NOT use AppleSystemProfiler under Jaguar: it
is just a shell script wrapping an AppleScript, a technique which has
many known bugs.
For getting the machine name, NSHost can be helpful.
--
=Nicholas Riley <email@hidden> | <
http://www.uiuc.edu/ph/www/njriley>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.