std.file.read
Pelle
pelle.mansson at gmail.com
Mon Aug 2 10:34:48 PDT 2010
On 08/02/2010 10:23 AM, Dmitry Olshansky wrote:
> On 02.08.2010 5:23, bearophile wrote:
>> Can you tell me why std.file.read() returns a void[] instead of
>> something like a ubyte[]?
>>
> Well, it magically converts to whatever array type you have. So this works:
> ubyte[] data = read("trash.txt");
This code does not work for me.
> It's interesting fact deserving further investigation. It seems that
> void[] arrays are converted implicitly, this also works:
> void[] tr = malloc(20)[0..20];
> data = tr;
Neither does this.
I am running 2.047, am I doing something wrong?
More information about the Digitalmars-d-learn
mailing list