• 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: How does one get the OS Product name programatically?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


http://developer.apple.com/technicalsupport


 _______________________________________________
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

References: 
 >How does one get the OS Product name programatically? (From: "David Litwin" <email@hidden>)

  • Prev by Date: Re: Shared mmap and data consistency upon a crash
  • Next by Date: Re: How does one get the OS Product name programmatically?
  • Previous by thread: Re: How does one get the OS Product name programatically?
  • Next by thread: Re: How does one get the OS Product name programmatically?
  • Index(es):
    • Date
    • Thread