Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bio.readto and EOF


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>

Follow-Ups:
Re: bio.readto and EOFOri Bernstein <ori@xxxxxxxxxxxxxx>
Re: bio.readto and EOFOri Bernstein <ori@xxxxxxxxxxxxxx>
References:
bio.readto and EOFCarlin Bingham <cb@xxxxxxxxxxxx>