Here's a minimal little template (checked):<br><br>import std.stdio;<br><br>void main()<br>{<br> auto f = File("outfile.txt", "w");<br> f.writefln("%s World", "Hello");<br>
f.close();<br>}<br><br><br><br><br><br><div class="gmail_quote">2010/10/6 Denis Koroskin <span dir="ltr"><<a href="mailto:2korden@gmail.com">2korden@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Wed, 06 Oct 2010 22:43:42 +0400, Dr. Smith <iam@far.out> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
This should be trivial. However, I've not found in the documentation (trying<br>
both std.stdio and std.file) how to write to a file in the manner here:<br>
<br>
filename.writefln("%s\t%f", someString, someDouble);<br>
<br>
... this merely prints filename to screen ... does not create a data file.<br>
</blockquote>
<br></div></div>
In your case, foo.bar(args) == bar(foo, args) - that is call Uniform Function Call Syntax, that is:<br>
<br>
filename.writefln("%s\t%f", someString, someDouble); -> writefln(filename, "%s\t%f", someString, someDouble);<br>
<br>
which in turn tries using filename as a format.<br>
<br>
Try using std.stream. It should be something like this:<br>
<br>
File file = new File(fileName, FileMode.OutNew); // open file for writing, create new if none exists<br>
file.writefln("hello, %s!", "world");<br>
<br>
Not tested but should work.<br>
</blockquote></div><br>