English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2010-07-08 (10:23)
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