In case you have not solved the 3rd problem yet (your code is
almost there),
it can be fixed by replacing this line:
rawfile.écrire(uncompress(efile_buf2)); // alias for
std.file.write
with this one:
(filename ~ ".out").écrire(uncompress(efile_buf2));
The lines that open files using std.stdio.File are not needed and
can be removed:
File efile = File(filename, "r");
File rawfile = File(filename ~ ".out", "w");
std.file.write works pretty much like this:
void write(string filename, void[] writeThis) {
import std.stdio;
File f = File(filename, "w");
f.rawWrite(writeThis);
f.close();
}
It expects a filename as an argument (not a std.stdio.File
structure representing an open file). std.file.read also expects
a filename, your code is calling that one correctly.
Using std.stdio.File is not necessary here because
std.file.read/write open and close the files on their own.
About your 2nd problem: its hard to tell whats going on without
more complete code. You may want to inspect the problematic
string using something like this:
string correct = "test.txt";
string tricky = std.string.strip(readln());
writeln("c: ", cast(ubyte[]) correct);
writeln("t: ", cast(ubyte[]) tricky);
This is going to print numeric codes of all bytes in the string
and reveal any potentially invisible characters (like spaces,
line-ending markers, tabs etc.), like this:
c: [116, 101, 115, 116, 46, 116, 120, 116]
t: [116, 101, 115, 116, 46, 116, 120, 116, 13]