August 31, 2003
Linux version file write/append bug

<pre>
import file;

int main()
{
byte[] t;
t ~= 33;
t ~= 34;
file.write("test",t); // or file.append("test",t);
return 0;
}
</pre>

both versions (write and append) will create a file
with 0 bytes.
Seems that phobos.file has:

numwritten = linux.write(fd, buffer, len);
if (len != numwritten)
goto err2;

but len never got initialized.

I changed file.d recompile and now it works fine.

(didn't know how to get the lenght from
OutBuffer.data - data.length doesn't work it has extra bytes (null) ???
I just pass the length to the write method in file)

Ant


August 31, 2003
Thanks for catching this. I'll take care of it. -Walter