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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e3ba37c5a979fdcb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!news.glorb.com!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Ada.Text_IO.Create (was: invalid parameter list) References: <1140218028.145204.141420@z14g2000cwz.googlegroups.com> <1140249851.389233.273980@g47g2000cwa.googlegroups.com> <1140297548.116832.212770@g43g2000cwa.googlegroups.com> <57OJf.45346$d5.201767@newsb.telia.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Date: Sun, 19 Feb 2006 00:15:35 GMT NNTP-Posting-Host: 83.250.106.90 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1140308135 83.250.106.90 (Sun, 19 Feb 2006 01:15:35 CET) NNTP-Posting-Date: Sun, 19 Feb 2006 01:15:35 CET Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:2972 Date: 2006-02-19T00:15:35+00:00 List-Id: 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