Re: How does one get the OS Product name programatically?
Re: How does one get the OS Product name programatically?
- Subject: Re: How does one get the OS Product name programatically?
- From: Garth Cummings <email@hidden>
- Date: Fri, 12 May 2006 09:29:22 -0700
Hi David,On May 10, 2006, at 11:39 AM, David Litwin wrote: 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. The same question was sent to DTS back in 2004, and we were assured at that time that checking those two plists is the supported way to get the OS version and determining if you're running Mac OS X vs. Mac OS X Server. HTH,--gc ____________________________________________________________________ Garth Cummings email@hidden Sr. Software Engineer Apple Developer Technical Support
|
_______________________________________________
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