1 /**
2  * Helper methods for utilizing file operations.
3  */
4 module util.file;
5 
6 import std.typecons;
7 
8 import iopipe.valve;
9 import iopipe.textpipe;
10 import iopipe.bufpipe;
11 import std.io;
12 
13 /*
14  * Creates an iopipe output range for characters to the filename specified.
15  */
16 @trusted
17 auto fileWriter(string filename) {
18     return bufd!char
19         .push!(p => p
20             .encodeText
21             .outputPipe(std.io.File(filename, mode!"w").refCounted))
22         .textOutput;
23 }