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.
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
NB. I've stolen the `Keep tag that was already there but apparently
never used. Not sure if it was intended for a higher purpose.
>From c230b380fbf0e7ba2c24aae332e4ce8016843d66 Mon Sep 17 00:00:00 2001
From: Carlin Bingham <firstname.lastname@example.org>
Date: Sat, 16 Mar 2019 10:20:23 +1300
Subject: [PATCH] Add bio.readtoinc - read to including delimiter
X-Spam-Status: No, hits=0.000000 required=0.900000
Similar to bio.readto except it includes the delimeter in the returned
slice if it was found, making the absence of the delimiter indicate EOF