summaryrefslogtreecommitdiff
path: root/lib/bio
AgeCommit message (Collapse)Author
2019-03-21Commit bio.readtermOri Bernstein
2019-03-21bio.readto and EOFCarlin Bingham
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. 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? -- Carlin 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 <cb@viennan.net> 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
2019-03-13readdelim: don't leak memory if there's an errorCarlin Bingham
2019-03-13Fix bio.readtoCarlin Bingham
Don't change rstart on each iteration as that prevents it being able to return characters at the start of the buffer if the delim is found, and only read characters from the buffer that were actually checked
2018-10-15Fixes to libbio (Thanks, Mike)Ori Bernstein
2018-10-14Fix boundary-spanning delimiters.Ori Bernstein
2018-10-12Don't readinto if we're dropping.Ori Bernstein
2018-10-12Actually read delimiter length bytes. Don't index out of bounds.Ori Bernstein
2018-07-10Make bio and regex disposable.Ori Bernstein
2018-03-10Clean up readinto.Ori Bernstein
2018-02-01Add test for bio skipto.Ori Bernstein
2018-02-02Fix std.skiptoCarlin Bingham
It would only skip past however many characters the delimeter was and would hang if the delimeter wasn't found before eof
2018-01-11Move to new trait syntax.Ori Bernstein
2018-01-03Split out backends from abstract bio types.Ori Bernstein
2017-10-12Minor cleanups on bio geti.Ori Bernstein
2017-09-30Replace bio.status(@t) with std.result(@t, bio.err)Ori Bernstein
It's more consistent.
2017-09-13Create output path before using itOri Bernstein
bio-unitwr could be executed before bio-write and tmpout/ doesn't exist yet in that case. Thanks Tobias Kortkamp.
2017-08-27Ordonly/Owronly => Oread/Owrite.Ori Bernstein
2017-07-25Remove spandrels.Ori Bernstein
Match patterns can't be null. They haven't been nullable for ages. And even if they could be nullable, $2 isn't the match statement any more.
2017-07-23Add back error signalling on close.Ori Bernstein
2017-07-22Terminate error message lines.Ori Bernstein
2017-07-17Convert from `in` to `:`.Ori Bernstein
The winds of change are a-blowin.
2017-06-25Fix some actual type bugs.Ori Bernstein
Strictness fixes issues. Oops.
2017-06-12Add missing file.Ori Bernstein
2017-06-11Add memfiles.Ori Bernstein
2017-05-24Allow arbitrary functions on bio files.biofuncOri Bernstein
2017-02-01Readability improvements.Ori Bernstein
Compress the match statement.
2017-02-01Implement 'bychar' for iterating characters.Ori Bernstein
2016-09-14Make sure that our output file exists.Ori Bernstein
2016-09-13Bio-delim was missing dependencies.Ori Bernstein
2016-09-13Add missing file.Ori Bernstein
2016-09-11Enable and update the bio tests.Ori Bernstein
2016-08-27Rename `std.Fail to `std.Err.Ori Bernstein
2016-06-19Add putv to bio.Ori Bernstein
2016-05-17New syntax for casts.Ori Bernstein
2016-02-06Fix bio bug.Ori Bernstein
Shift the start of the buffer down when filling if needed.
2016-02-04Make std.sljoin consistent.Ori Bernstein
2016-01-23Move away from ".use" suffix.Ori Bernstein
2016-01-21bio.read(f, [][:]) should succeed without Eof.Ori Bernstein
A read of 0 could be from two cases: EOF, or a zero byte length request. Since a zero byte length request can always be satisifed, it probably shouldn't be an EOF. Especially since this sort of request can show up in the middle of a file. Yes, this is a bit strange to me too, but it seems the most consistent.
2016-01-07rename fooiter -> byfooOri Bernstein
2015-12-30Add support for by-line iteration to bio.Ori Bernstein
2015-12-30Tag all types in impl statements.Ori Bernstein
2015-12-29Drop read buffer on seek.Ori Bernstein
Simple, easy, and absolutely not optimal.
2015-12-29The makefile isn't used.Ori Bernstein
2015-12-29Avoid spurious reads.Ori Bernstein
We were reading more than we should have. This fixes it.
2015-12-27typo in bio.ensureread()Ori Bernstein
We should return n if we read exactly n bytes, as well as more than n bytes.
2015-10-14Fix the handling of '\r\n'.Ori Bernstein
We were returning a spurious empty string. Oops.
2015-10-06Fix up error handling for syswrap+posixy.myrOri Bernstein
2015-10-04Drop buffer on flush error.Ori Bernstein
We don't want to end up with the buffers left while in an error state.
2015-10-04Actually return the error that occurred.Ori Bernstein