From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f890526de6a8a218 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-peer0-test!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: How to detect OS type and version? Date: Thu, 13 Oct 2005 06:05:49 +0000 (UTC) Organization: BT Openworld Message-ID: References: NNTP-Posting-Host: host86-131-222-95.range86-131.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com 1129183549 8942 86.131.222.95 (13 Oct 2005 06:05:49 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Thu, 13 Oct 2005 06:05:49 +0000 (UTC) In-Reply-To: X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) Xref: g2news1.google.com comp.lang.ada:5587 Date: 2005-10-13T06:05:49+00:00 List-Id: Roger Blum wrote: > Is there a way within Ada (GNAT 3.15p) to tell whether the application is > running on Linux or Windows (and the version of the OS)? There is no single standard why... yet! I think that you will be able to do this with "package Ada.Environment_Variables" come Ada200Y, e.g. if Ada.Environment_Variables.Exists ("OS") and Ada.Environment_Variables.Value ("OS") = "Windows_NT" then ... elsif Ada.Environment_Variables.Exists ("OSTYPE") and Ada.Environment_Variables.Value ("OSTYPE") = "linux-gnu" then ... else -- Unknown OS ... end if; I have a (partially tested) version of this package. If you (or anyone else) would like it, please email me directly and I'll see what I can do! :-) Cheers -- Martin