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, LOTS_OF_MONEY autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.157.32.47 with SMTP id n44mr21660676ota.45.1459982547397; Wed, 06 Apr 2016 15:42:27 -0700 (PDT) X-Received: by 10.157.59.194 with SMTP id k60mr520248otc.7.1459982547368; Wed, 06 Apr 2016 15:42:27 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!nt3no8443456igb.0!news-out.google.com!u9ni663igk.0!nntp.google.com!nt3no8443455igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 6 Apr 2016 15:42:27 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=149.32.224.36; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 149.32.224.36 References: <57053167$0$4216$e4fe514c@news.kpn.nl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <533e9e24-e8b6-42e0-b80c-10eae266ee64@googlegroups.com> Subject: Re: How to find the type of operating system. From: Anh Vo Injection-Date: Wed, 06 Apr 2016 22:42:27 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30028 Date: 2016-04-06T15:42:27-07:00 List-Id: On Wednesday, April 6, 2016 at 2:41:33 PM UTC-7, Randy Brukardt wrote: > "ldries46" wrote in message > news:57053167$0$4216$e4fe514c@news.kpn.nl... > > How can I fin in which operating system a program runs and other details > > of that operating system. > > Ada has System.System_Name provides an implementation-defined indication of > the name of the target, but that often isn't set in any useful way. (Dunno > what GNAT does with it, if anything.) With GNAT, I managed to make it work for Windows and Linux/Unix not long ago. Dir_Separator : Character; pragma Import (C, Dir_Separator, "__gnat_dir_separator"); --... Put_Line ("The program is run on OS: => " & (if Dir_Separator = '\' then "Windows" else "Unix/Linux")); Anh Vo