Weird stream write output

alkololl meltor at trash-mail.com
Wed Nov 27 15:50:24 PST 2013


Hi,

My program does not do what I want it to do.

import std.stdio;
import std.stream;

int main(string[] argv) {
	Stream file = new BufferedFile("D:\\test.txt", FileMode.OutNew);
	char[] patch = [ 0x41, 0x41, 0x41, 0x41, 0x41 ];

	file.write(patch);
	file.close();

	writeln("press enter to exit");
	getchar();
	return 0;
}

gives me this output (the following line is the content of 
test.txt)
|   AAAAA

As you can see there are another 5 characters right before the 
five 'A'.
It seems that D fails with the proper encoding?

Thansk for help



More information about the Digitalmars-d mailing list