D Documentation  
write
void write(char[] name, void[] buffer)

This function writes buffer to name.
It can throw a FileException

Example:
// Import standard-in-out
import std.stdio;
import std.file;

// Main function
int main(char[][] args)
{
  try
  {
    write("test.txt","Hallo Welt!");
    writefln("Successfully wrote file 'test.txt'");
  }
  catch (FileException xy)
  {
    writefln("A file exception occured: " ~ xy.toString());
  }
  catch (Exception xx)
  {
    writefln("An exception occured: " ~ xx.toString());
  }
  return 0;
}

See also:
FileException, exists, isfile, read, append
Created using PHP docwiki written by Markus Dangl. Best viewed with Mozilla Firefox.