[Openmcl-devel] Determining OSX version at runtime

Neil Baylis neil.baylis at gmail.com
Thu Aug 26 10:06:42 PDT 2010


The Apple release notes for Snow Leopard suggest using
NSAppKitVersionNumber.
On my Snow Leopard system, I see

CL-USER> (apropos "NSAppKit")
X86-DARWIN64::|NSAppKitVersionNumber|

But on my 32 bit ppc Leopard system, apropos doesn't know anything about it.

(Both systems using ccl 1.5)

Neil

On Thu, Aug 26, 2010 at 9:39 AM, Raffael Cavallaro <raffaelcavallaro at mac.com
> wrote:

>
> 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
>
>
>
>
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>



-- 
http://www.pixpopuli.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20100826/a948e5cb/attachment.htm>


More information about the Openmcl-devel mailing list