[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bio.readto and EOF
- Subject: Re: bio.readto and EOF
- From: Ori Bernstein <ori@xxxxxxxxxxxxxx>
- Reply-to: myrddin-dev@xxxxxxxxxxxxxx
- Date: Fri, 15 Mar 2019 15:51:21 -0700
- To: myrddin-dev@xxxxxxxxxxxxxx
- Cc: Carlin Bingham <cb@xxxxxxxxxxxx>
On Sat, 16 Mar 2019 10:58:26 +1300
Carlin Bingham <cb@xxxxxxxxxxxx> wrote:
> Hi,
>
> When using bio.readto I often want to be able to tell if the delimeter
> was found, or if the file was truncated, but there doesn't appear to
> be a way to tell if readto stopped searching because it found what it
> was looking for or if it reached EOF, other than to do another read.
I don't remember wanting it very often -- but I can see the purpose.
> A simple solution to this would be a new function that reads to and
> includes the delimeter in the returned slice if it was found, which can
> be used intead when you care. I've tentatively included a patch for this.
>
> Is this something that would be wanted? Is there a better solution? Or a
> better name?
readdelim or readterm?
--
Ori Bernstein <ori@xxxxxxxxxxxxxx>