On 12/11/17 22:21, Pádraig Brady wrote: > On 12/11/17 21:52, Paul Eggert wrote: >> Why doesn't lseek work for this? > > Good call, it probably would. > Something like the following is more acceptable > since it adds very little complexity: Full patch attached with tests. cheers, Pádraig