From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.8 required=3.0 tests=BAYES_00,FREEMAIL_FROM, PLING_QUERY autolearn=no autolearn_force=no version=3.4.6 X-Received: by 2002:a37:a111:: with SMTP id k17mr1739920qke.496.1625259451012; Fri, 02 Jul 2021 13:57:31 -0700 (PDT) X-Received: by 2002:a5b:58e:: with SMTP id l14mr1724038ybp.303.1625259450838; Fri, 02 Jul 2021 13:57:30 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc3.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 2 Jul 2021 13:57:30 -0700 (PDT) In-Reply-To: <68f867d3-2b83-4092-a33e-0fcc78f5a24bn@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=146.5.2.231; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.231 References: <68f867d3-2b83-4092-a33e-0fcc78f5a24bn@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Hi! How I can make _indexed_ stream file Input/Output ? Thanks. From: Shark8 Injection-Date: Fri, 02 Jul 2021 20:57:31 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 1976 Xref: reader02.eternal-september.org comp.lang.ada:62317 List-Id: On Sunday, June 27, 2021 at 1:33:28 PM UTC-6, daniel wrote: > How I can make _indexed_ stream file Input/Output ?=20 >=20 > For 'indexed' i mean manually setting file position:=20 > =3D> 'from' in $type'input() and=20 > =3D> 'to' in $type'output()=20 >=20 > Actually I use Ada.Streams.Stream_IO.=20 >=20 > My main need is examples.=20 >=20 > Thanks!=20 > Best Whishes,=20 > Dani. Streams are a bit different than files; you see, streams are an abstraction= on input/output and therefore different than files. Consider, for example,= an output stream that controls a radio transmitter. There's no possible wa= y to "unsend" the data: it's a write-only device. If you're using Ada's standard library, with the XXX_IO packages, I believe= what you want is Ada.Direct_IO.