From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: How to find the type of operating system.
Date: Thu, 7 Apr 2016 09:33:37 -0700
Date: 2016-04-07T09:33:37-07:00 [thread overview]
Message-ID: <ne61us$h4g$1@dont-email.me> (raw)
In-Reply-To: <ne52bn$ufp$1@loke.gir.dk>
On 04/07/2016 12:31 AM, Randy Brukardt wrote:
> "Simon Wright" <simon@pushface.org> wrote in message
> news:lyoa9ludbf.fsf@pushface.org...
>> Anh Vo <anhvofrcaus@gmail.com> writes:
>>>
>>> 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"));
>>
>> GNAT.OS_Lib.Directory_Separator provides exactly this functionality.
>
> Presumably you could get that value from a suitable use of
> Ada.Directories.Compose, which would eliminate the
> implementation-definedness for at least that check. But what you'd decide on
> VMS I'm not sure. :-)
Clearly, "Unix/Linux".
--
Jeff Carter
"They name the boy Jonathan Ralph Starkwell,
after Virgil's mother."
Take the Money and Run
141
next prev parent reply other threads:[~2016-04-07 16:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-06 15:55 How to find the type of operating system ldries46
2016-04-06 21:41 ` Randy Brukardt
2016-04-06 22:42 ` Anh Vo
2016-04-07 6:45 ` Simon Wright
2016-04-07 7:31 ` Randy Brukardt
2016-04-07 16:33 ` Jeffrey R. Carter [this message]
2016-04-07 11:20 ` Lucretia
2016-06-24 21:12 ` Victor Porton
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox