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,FREEMAIL_FROM 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!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Michael Bode Newsgroups: comp.lang.ada Subject: Re: How to detect OS type and version? Date: Thu, 13 Oct 2005 23:04:45 +0200 Organization: 1&1 Internet AG Message-ID: <87mzldf7rm.fsf@code-hal.de> References: NNTP-Posting-Host: p54af125d.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: online.de 1129237486 31798 84.175.18.93 (13 Oct 2005 21:04:46 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Thu, 13 Oct 2005 21:04:46 +0000 (UTC) X-message-flag: IMPORTANT MESSAGE -- PLEASE READ IMMEDIATELY!!! X-Accepted-File-Formats: ASCII, .rtf, .ps, .pdf - *NO* MS Office files User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:II99v+GCzdUIPm5sV3KL/K9Vv7A= Xref: g2news1.google.com comp.lang.ada:5614 Date: 2005-10-13T23:04:45+02:00 List-Id: Martin Dowie writes: > 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") He could use GNAT.Os_Lib.Getenv ("OSTYPE") -- Michael Bode