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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Determining size of Standard_Input (when file contents are piped into a program). Date: Sun, 6 Jan 2019 14:51:12 +0200 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net G8fqJxVcCEsPLBdf4ywd+QxGhJR1+jkzt735yxwMnw/bMWlbOx Cancel-Lock: sha1:HvR0dolT+EGhtvkmIJ45GMVVSaI= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:55219 Date: 2019-01-06T14:51:12+02:00 List-Id: 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 . @ .