Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Distinguish between osx and linux programmatically
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Distinguish between osx and linux programmatically
On Thu, Jul 08, 2010 at 12:02:48PM +0200, Daniel Bünzli wrote:
> Is there something in the standard library that allows me to
> distinguish between oxs and linux (Sys.os_type just returns "Unix" for
> both).

How about running the external "uname" program.  On Mac OS X
it prints:

$ uname 

On all Linux distros it prints:

$ uname

Of course, only run external "uname" if Sys.os_type = "Unix".


Richard Jones
Red Hat