Sandbox.writeFile

Write a file to the sanbox

  1. void writeFile(in string fileName, in string output = "")
  2. void writeFile(in string fileName, in string[] lines)
    struct Sandbox
    void
    writeFile
    const
    (
    in string fileName
    ,
    in string[] lines
    )

Examples

1 import std.file: exists;
2 import std.path: buildPath;
3 
4 with(immutable Sandbox()) {
5     assert(!buildPath(testPath, "foo.txt").exists);
6     writeFile("foo.txt");
7     assert(buildPath(testPath, "foo.txt").exists);
8 }

Meta