Transient ranges

Patrick Schluter via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 1 07:05:00 PDT 2016


On Tuesday, 31 May 2016 at 12:42:23 UTC, Steven Schveighoffer 
wrote:

> There are 2 main issues with FILE *:
>
> 1) it does not provide buffer access, so you must rely on 
> things like getline if they exist. But these have their own 
> problems (i.e. do not support unicode, require C-malloc'd 
> buffer)
>
You can cheat by using setvbuf() and imposing your own buffer to 
the FILE* routine. What and how the underlying implementation put 
in that buffer is of course not documented but not very difficult 
to guess (for example fseek()/fread() will always fill the buffer 
from 0 to the end (of buffer or file depending what come first).


More information about the Digitalmars-d mailing list