What is the std.stream replacement?
Jonathan M Davis via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jul 19 21:51:34 PDT 2015
On Sunday, July 19, 2015 09:56:11 Charles Hixson via Digitalmars-d-learn wrote:
> I have DMD64 D Compiler v2.067.1 installed, and in the documentation of
> phobos what it says about std.stream is "don't use it on new code". It
> doesn't, however, appear to offer any replacement. Certainly std.file,
> std.stdio, and std.path aren't replacements.
>
> So what *is* the appropriate replacement? More specificly, what should
> one use for binary i/o, particularly random access binary i/o? With
> fixed block size.
Either use std.stdio.File - e.g. byChunk will allow you to read files as a
range of chunks. Or you can use std.mmfile.MmFile to use memory-mapped I/O
and operate on the file as a dynamic array (which is about as efficient as
it gets). If you want random access, MmFile would likely be the best option
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list