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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:294f:: with SMTP id p76mr6313225itp.34.1546786428668; Sun, 06 Jan 2019 06:53:48 -0800 (PST) X-Received: by 2002:aca:cc0f:: with SMTP id c15mr725497oig.3.1546786428430; Sun, 06 Jan 2019 06:53:48 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!q69no552874itb.0!news-out.google.com!v71ni546ita.0!nntp.google.com!k10no554247itk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 6 Jan 2019 06:53:48 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.116.183.48; posting-account=z-xFXQkAAABpEOAnT3LViyFXc8dmoW_p NNTP-Posting-Host: 87.116.183.48 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Determining size of Standard_Input (when file contents are piped into a program). From: Bojan Bozovic Injection-Date: Sun, 06 Jan 2019 14:53:48 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55224 Date: 2019-01-06T06:53:48-08:00 List-Id: On Sunday, January 6, 2019 at 1:51:11 PM UTC+1, Niklas Holsti wrote: > On 19-01-06 13:02 , Bojan Bozovic wrote: > > Is there platform independent way to do this? I was unable to find > > anything in RM under Ada.text_IO. > > I would say that this is impossible in principle. On some systems, other > concurrent programs can write more data into the input file as your > program is reading the file, so the input file can grow during the > execution of the program, and may not even have any fixed upper bound on > its size (apart from the total space available in the system). > > IMO the only robust way is to read all of standard input and store it > within the program, or in a temporary file, and then process the stored > data. > > -- > Niklas Holsti > Tidorum Ltd > niklas holsti tidorum fi > . @ . Yes that makes sense. Thank you.