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.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!news.freedyn.de!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe005.abavia.com!abe001.abavia.com!proxad.net!feeder1-1.proxad.net!cleanfeed1-b.proxad.net!nnrp4-2.free.fr!not-for-mail Date: Fri, 14 Jan 2022 19:30:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Newsgroups: comp.lang.ada Content-Language: en-US From: DrPi <314@drpi.fr> Subject: Usage of Stream Set_Index() function Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <61e1c144$0$6478$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 14 Jan 2022 19:30:28 CET NNTP-Posting-Host: 82.65.30.55 X-Trace: 1642185028 news-1.free.fr 6478 82.65.30.55:58440 X-Complaints-To: abuse@proxad.net X-Received-Bytes: 1514 Xref: reader02.eternal-september.org comp.lang.ada:63375 List-Id: Hi, I'm writing an application where I read a file with a complex structure. For this, I use Ada.Streams.Stream_IO package. To read the file, I need to position the file pointer to the correct location. I do this using Set_Index(). In ARM A.12.1, it is stated : For Read and Write with a Positive_Count parameter, the value of the current index is set to the value of the Positive_Count parameter plus the number of stream elements read or written. I don't understand the "plus the number of stream elements read or written". Does this mean one can't go back to beginning of file once data have been read ? Nicolas