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=-0.4 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f9642664cfbe6417,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!e9g2000vbk.googlegroups.com!not-for-mail From: Emile8 Newsgroups: comp.lang.ada Subject: ACCESS TO SYSTEM VARIABLES Date: Mon, 7 Mar 2011 01:34:24 -0800 (PST) Organization: http://groups.google.com Message-ID: <31c9ef20-db49-4d3e-bafb-0d2a5dca7866@e9g2000vbk.googlegroups.com> NNTP-Posting-Host: 192.54.144.229 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1299490464 4589 127.0.0.1 (7 Mar 2011 09:34:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 7 Mar 2011 09:34:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e9g2000vbk.googlegroups.com; posting-host=192.54.144.229; posting-account=u9P-fgoAAAB1qVhsrmxVpcdi-eIb_an8 User-Agent: G2/1.0 X-HTTP-Via: 1.1 caspi01.aes.alcatel.fr:3128 (squid/2.7.STABLE9) X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17937 Date: 2011-03-07T01:34:24-08:00 List-Id: On Linux I want to know the number of lines and columns of my working terminal. When on the command line I call by hand the system variables $LINES and $COLUMNS, I get the right answers. When I try to do the same from a program written in Gnat Ada 2005 (Year 2010) using the specialized package Ada.Environment_Variables, as in the following code called from the same terminal, I get no answer for COLUMNS and LINES as if the corresponding system variables do not exist (I get a correct answer for PATH). with Ada.Environment_Variables; use Ada.Environment_Variables; with Ada.Text_Io; use Ada.Text_Io; procedure Print_Env is begin Put_Line("Columns : " & Value("COLUMNS")); Put_Line("Lines : " & Value("LINES")); Put_Line("Path : " & Value("PATH")); end Print_Env; I would like to understand the reasons of this behavior. Are there different kinds of system variables in Linux ? Those as HOME, PATH whose values depend only on the user session and those as LINES, COLUMNS defined for each used terminal. Is there a way in Ada to overcome this limitation ?