comp.lang.ada
 help / color / mirror / Atom feed
From: Bojan Bozovic <bozovic.bojan@gmail.com>
Subject: Re: Determining size of Standard_Input (when file contents are piped into a program).
Date: Sun, 6 Jan 2019 06:53:48 -0800 (PST)
Date: 2019-01-06T06:53:48-08:00	[thread overview]
Message-ID: <a5d101fd-42f2-4a5d-b6e3-49d614f6c1fd@googlegroups.com> (raw)
In-Reply-To: <g9ebtsFkj47U1@mid.individual.net>

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.

  reply	other threads:[~2019-01-06 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-06 11:02 Determining size of Standard_Input (when file contents are piped into a program) Bojan Bozovic
2019-01-06 12:51 ` Niklas Holsti
2019-01-06 14:53   ` Bojan Bozovic [this message]
2019-01-07  3:05   ` Keith Thompson
2019-01-07  9:32     ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox