[Openmcl-devel] Determining OSX version at runtime

Raffael Cavallaro raffaelcavallaro at mac.com
Thu Aug 26 09:39:36 PDT 2010


On Aug 26, 2010, at 12:17 PM, Gary Palter wrote:

> Yes, you can use (software-version).  On Mac OS X, the first number is the major release + 4, the second number is the minor release, and the third number is usually zero.
> 
> So, 9.8.0 is OS X 10.5.8 and 10.4.0  is OS X 10.6.4.

you can also cheat and get the product version directly (though this is not considered the correct method by apple):

? (defun mac-os-x-version ()
   (ccl::with-autorelease-pool
       (let* ((plist
               (#/dictionaryWithContentsOfFile: ns:ns-dictionary #@"/System/Library/CoreServices/SystemVersion.plist")))
         (ccl::lisp-string-from-nsstring (#/valueForKey: plist #@"ProductVersion")))))

? (mac-os-x-version)
"10.6.4"

warmest regards,

Ralph


Raffael Cavallaro
raffaelcavallaro at me.com








More information about the Openmcl-devel mailing list