phobo's std.file is completely broke!

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue Sep 18 09:25:39 UTC 2018


On Tuesday, 18 September 2018 at 06:16:50 UTC, Ecstatic Coder 
wrote:
> This attitude is unfortunately the cause of a lot frustration 
> among cross-platform developers like me.
>
> I chose D for my file scripting needs because it's a 
> cross-platform language.
>
> I expect that calling the function F on system X will work the 
> same as calling that same function on system Y.

You ask for the impossible.

How do you expect the following to "work the same" across all 
platforms:

	import std.stdio;
	import std.file;
	auto fn = "a.txt";
	auto f = File(fn, "w");
	remove(fn);

or this:

	import std.file;
	write("a", "a");
	write("A", "A");
	assert(readText("a") == "a");
	assert(readText("A") == "A");

There will always be inherent differences between platforms, 
because they are wildly different. Using this sentiment as an 
argument for Phobos to smooth over this one particular difference 
that you care about, and for which incidentally an apparent 
solution appears to be available, is fallacious.



More information about the Digitalmars-d mailing list