Eigenstate: myrddin-dev mailing list

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

Re: bio.readto and EOF


On Fri, 15 Mar 2019 15:51:21 -0700, Ori Bernstein <ori@xxxxxxxxxxxxxx> wrote:

> 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?
> 

Committed under the name readterm

-- 
    Ori Bernstein

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