From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a05:620a:1092:: with SMTP id g18mr3217797qkk.184.1600920633708; Wed, 23 Sep 2020 21:10:33 -0700 (PDT) X-Received: by 2002:a0c:8c4c:: with SMTP id o12mr3136787qvb.46.1600920633613; Wed, 23 Sep 2020 21:10:33 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 23 Sep 2020 21:10:33 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=103.238.106.212; posting-account=9hKPWAoAAAAuQhSnmI8oNRPlWYMuRDJy NNTP-Posting-Host: 103.238.106.212 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4bd08b3a-50d4-4636-8674-6dc7cb4efd85o@googlegroups.com> Subject: Re: Ada.Text_IO.File_Type object with user defined Get and Put subprograms. From: nimaopatel121@gmail.com Injection-Date: Thu, 24 Sep 2020 04:10:33 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:60260 List-Id: On Friday, 31 July 2020 01:51:10 UTC+5:30, Blady wrote: > Hello, > > Given a legacy code calling many Put_Line from Ada.Text_IO which works > nice in a Terminal, I want to add a mode which sends these outputs to > another process without changing the legacy code too much. > And I want to keep the Terminal mode. > > Is there a way to create a File_Type object (from Ada.Text_IO) which > would have user defined Get and Put subprograms instead of the > predefined ones of the file system? > > Thus in my case, I will create a custom File_Type object My_Output with > the user define Put which will send the lines to the other process and > then I will call "Set_Output (My_Ouput);" before the legacy code. > > Thanks Pascal.