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.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,e771677aa5f6a605 X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: how to designate standard input from another file Date: 2000/06/05 Message-ID: <8hgnp5$r7k$1@wanadoo.fr>#1/1 X-Deja-AN: 631358342 References: X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 960225893 27892 193.250.170.200 (5 Jun 2000 17:24:53 GMT) Organization: Adalog X-MSMail-Priority: Normal NNTP-Posting-Date: 5 Jun 2000 17:24:53 GMT Newsgroups: comp.lang.ada Date: 2000-06-05T17:24:53+00:00 List-Id: Terry Westley a �crit dans le message : amQ_4.2$m22.237@wdc-read-01.qwest.net... > Something like this would be nice except that File_Type is > limited private: > > declare > File : Ada.Text_IO.File_Type; > begin > if File_Name = "-" then > File := Ada.Text_IO.Standard_Input; > else > Ada.Text_IO.Open (File, In_File, File_Name); > end if; > end; > Do it the other way round, i.e. read from Standard_Input, and redirect it if necessary: declare File : Ada.Text_IO.File_Type; begin if File_Name /= "-" then Ada.Text_IO.Open (File, In_File, File_Name); Ada.Text_IO.Set_Input (File); end if; end;