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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8f6dc5bfebaf357f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 20 May 2005 12:52:22 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: "broken pipe" while reading/writing stream-based sockets References: <1116601288.424625.176760@g14g2000cwa.googlegroups.com> X-Newsreader: Tom's custom newsreader Message-ID: Date: Fri, 20 May 2005 12:52:22 -0500 NNTP-Posting-Host: 24.6.127.15 X-Trace: sv3-ojybYCnPlAwIO/JS/ueB4J1cwKT1jI6HQbSoFHiZhAvedyVycH+MayjdIOheY6I9y9gEA/8rsSXToL1!Emb7xaxlkVQBYHOqzdN3bN6uyF0Wuz/WFQNtc6Hw1kkpiUP6vBQkXNhcHQA= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.31 Xref: g2news1.google.com comp.lang.ada:11106 Date: 2005-05-20T12:52:22-05:00 List-Id: > In C I know how to read() in a loop and increment a pointer to a buffer > (a C string) while receiving characters until there are no more of > them. It is sufficient that read() returns how many characters has > already read and some little math involving buffer size. > > In Ada I don't know how to do it... Can you please give me any > suggestions? Buffer : String(a .. b); Last : Natural := Buffer'first-1; begin while Last < Buffer'last loop read(input_source, Buffer(Last+1 .. Buffer'last), Last); end loop;