[Haskell-cafe] Detect Either Windows or Linux environment

SevenThunders mattcbro at earthlink.net
Sat May 5 01:23:20 EDT 2007




Brandon S. Allbery KF8NH wrote:
> 
> 
> On May 5, 2007, at 0:21 , SevenThunders wrote:
>> Is there a simple way to detect what operating system a given  
>> Haskell program
>> is running under?
> 
> mress:5002 Z$ ghci
>     ___         ___ _
>    / _ \ /\  /\/ __(_)
> / /_\// /_/ / /  | |      GHC Interactive, version 6.7.20070322, for  
> Haskell 98.
> / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
> \____/\/ /_/\____/|_|      Type :? for help.
> 
> Loading package base ... linking ... done.
> Prelude> :m +System.Info
> Prelude System.Info> [os, arch]
> ["darwin","powerpc"]
> Prelude System.Info>
> 
> -- 
> brandon s. allbery  [solaris,freebsd,perl,pugs,haskell]   
> allbery at kf8nh.com
> system administrator  [openafs,heimdal,too many hats]   
> allbery at ece.cmu.edu
> electrical and computer engineering, carnegie mellon university       
> KF8NH
> 
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 

Thank you for your help.  I somehow missed that when I was browsing through
the library documentation.
On windows, interestingly the os function returns "mingw"
-- 
View this message in context: http://www.nabble.com/Detect-Either-Windows-or-Linux-environment-tf3695277.html#a10333801
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list