How does one get the OS Product name programatically?
How does one get the OS Product name programatically?
- Subject: How does one get the OS Product name programatically?
- From: "David Litwin" <email@hidden>
- Date: Wed, 10 May 2006 11:39:27 -0700
- Thread-topic: How does one get the OS Product name programatically?
From posts on macos-x-server I see that “sw_vers
–productName” will give me exactly what I am looking for (i.e.
whether I am running Mac OS X or Mac OS X Server), but I’d like to get
this within my program without having to shell out to a tool (it gets it from *some* API).
The man page mentions both
/System/Library/CoreServices/SystemVersion.plist and
/System/Library/CoreServices/ServerVersion.plist. The second file only
exists on Server machines, so I suppose I could write my code to grab the
“ProductName” string from ServerVersion.plist if it exists,
otherwise grab it from SystemVersion.plist.
Is this the recommended way of determining “Mac OS
X” vs. “Mac OS X Server”? It seems like testing for a
file’s existence is a bit, well, fragile.
David Litwin
BigFix, Inc.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden