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

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

  • Follow-Ups:
    • Re: How does one get the OS Product name programmatically?
      • From: Peter Bierman <email@hidden>
    • Re: How does one get the OS Product name programatically?
      • From: Garth Cummings <email@hidden>
    • Re: How does one get the OS Product name programatically?
      • From: "Finlay Dobbie" <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 programatically?
  • Previous by thread: Re: Shared mmap and data consistency upon a crash
  • Next by thread: Re: How does one get the OS Product name programatically?
  • Index(es):
    • Date
    • Thread