comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: Ada.Text_IO.Create (was: invalid parameter list)
Date: Sun, 19 Feb 2006 00:15:35 GMT
Date: 2006-02-19T00:15:35+00:00	[thread overview]
Message-ID: <HMOJf.45349$d5.201704@newsb.telia.net> (raw)
In-Reply-To: <dt8aup$36b$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com>

Martin Dowie wrote:
> Beware that if the file already exists Ada.Text_IO.Create will raise an 
> exception, so you have to use a "begin ... exception ... end;" block.

Really? I don't see that in AARM95 A.8.2 or A.10.2.

The following test program works just fine with GCC 4.0.2 on Fedora 4:

with Ada.Text_IO;
procedure Creation_Test is
    The_File  : Ada.Text_IO.File_Type;
    File_Name : String := "test_file";
begin
    Ada.Text_IO.Create(The_File, Ada.Text_IO.Out_File, File_Name);
    Ada.Text_IO.Put(The_File, "one");
    Ada.Text_IO.Close(The_File);
    Ada.Text_IO.Create(The_File, Ada.Text_IO.Out_File, File_Name);
    Ada.Text_IO.Put(The_File, "two");
    Ada.Text_IO.Close(The_File);
end Creation_Test;

$ gnatmake creation_test
gcc -c creation_test.adb
gnatbind -x creation_test.ali
gnatlink creation_test.ali
$ ./creation_test
$ ./creation_test
$ ./creation_test
$ cat test_file
two
$

-- 
Bj�rn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu



  parent reply	other threads:[~2006-02-19  0:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17 23:13 invalid parameter list isaac2004
2006-02-18  6:02 ` jimmaureenrogers
     [not found] ` <tfadv19pqf17h3prdhquk3e5f30j6vhdhl@4ax.com>
2006-02-18  8:04   ` isaac2004
2006-02-18 14:34     ` Björn Persson
2006-02-18 21:19       ` isaac2004
2006-02-18 23:31         ` Björn Persson
2006-02-18 23:34           ` Martin Dowie
2006-02-19  0:06             ` isaac2004
     [not found]               ` <dmlfv11b4qagaf3gec853k9on191576gqc@4ax.com>
2006-02-19  4:06                 ` isaac2004
     [not found]                   ` <uavfv1pjdorpim6lpu8sjfdlq4lmmn1jes@4ax.com>
2006-02-19 16:21                     ` Björn Persson
2006-02-19 15:54               ` Björn Persson
2006-02-19  0:15             ` Björn Persson [this message]
2006-02-19  8:14               ` Ada.Text_IO.Create Martin Dowie
2006-02-19 19:45                 ` Ada.Text_IO.Create Jeffrey R. Carter
2006-02-19 21:49                   ` Ada.Text_IO.Create Larry Kilgallen
2006-02-20  6:09                     ` Ada.Text_IO.Create isaac2004
2006-02-20  6:43                       ` Ada.Text_IO.Create Gautier
     [not found]                       ` <3stiv1l39144oscbs5he2v6h5uvfmli03q@4ax.com>
2006-02-21 22:15                         ` Ada.Text_IO.Create isaac2004
2006-02-22  7:45                           ` Range error (was: Ada.Text_IO.Create) Björn Persson
2006-02-22  8:27                             ` Range error Björn Persson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox