On 10/22/2015 11:20 AM, pineapple wrote:
> I'd like to use fread and fwrite in place of File.rawRead and
> File.rawWrite which force the creation of an array where I'd rather
> specify a buffer location and length.
Would you not create that buffer? :)
If you already have a piece of memory, it is trivial to convert it to a
slice in D:
auto slice = existing_pointer[0 .. number_of_elements];
http://ddili.org/ders/d.en/pointers.html#ix_pointers.slice%20from%20pointer
The operation is not expensive because D slices are nothing but a
pointer and length.
Ali