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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8180bee0588d30e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-16 01:06:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!skynet.be!skynet.be!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Marius Amado Alves Newsgroups: comp.lang.ada Subject: Re: SEQUENTIA_IO and stdin/stdout (Standard_Input, Standard_Output) Date: Wed, 15 Oct 2003 17:23:41 +0000 Organization: Cuivre, Argent, Or Message-ID: References: <55cccaab.0310140444.4ac20d7f@posting.google.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1066291542 45225 80.67.180.195 (16 Oct 2003 08:05:42 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 16 Oct 2003 08:05:42 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: X-Mailer: Ximian Evolution 1.4.5 X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:952 Date: 2003-10-15T17:23:41+00:00 > Which of the three steps is not guaranteed ? > > Finding the value of File_Type > Finding the name of the corresponding file > Opening the file > > If it is the last, I would expect a failure to open would signal an exception. I would to. But GNAT does not complaint. At least with a sequential file of characters. It simply does not output. Maybe it's because I'm not closing Standard_Output prior to opening it as a sequential file. But I wouldn't know how to do that. Procedure Close requires a variable, and you cannot set a file type variable to Standard_Output (because File_Type is limited). I agree some kind of clarification on this issue is desirable. Maybe it has been done already. Or a binding interpretation. Someone should check it out ;-) Note Robert Eachus already said "it may or may not work". Maybe he's willing to elaborate ;-) Personally I don't feel comfortable with two things: 1. The (external) name of a standard channel. Even in C this does not exist. GNAT says "*stdout", "*stdin". Note the asterisk. This reeks of implementation dependency. I seem to remember MS-DOS having "CON" for this. I think the ARM is silent on this anyway. 2. Crossing information between Text_IO and (an instance of) Sequential_IO. Even if this information is just the name of the external file. In sum: there is doubtful solution (and erroneous with GNAT, or so it seems), and there is an alternate, legal solution. The choice should be clear. As I indicated before, I suspect Ada has a weak point here. Namely binding the standard channels exclusively to Text_IO. Surely the standard channel concept is less dependent of file format than that.