Here's a minimal little template (checked):
import std.stdio;
void main()
{
auto f = File("outfile.txt", "w");
f.writefln("%s World", "Hello");
f.close();
}
In your case, foo.bar(args) == bar(foo, args) - that is call Uniform Function Call Syntax, that is:On Wed, 06 Oct 2010 22:43:42 +0400, Dr. Smith <iam@far.out> wrote:
This should be trivial. However, I've not found in the documentation (trying
both std.stdio and std.file) how to write to a file in the manner here:
filename.writefln("%s\t%f", someString, someDouble);
... this merely prints filename to screen ... does not create a data file.
filename.writefln("%s\t%f", someString, someDouble); -> writefln(filename, "%s\t%f", someString, someDouble);
which in turn tries using filename as a format.
Try using std.stream. It should be something like this:
File file = new File(fileName, FileMode.OutNew); // open file for writing, create new if none exists
file.writefln("hello, %s!", "world");
Not tested but should work.