digitalmars.D.learn - Output range for file?
- Tofu Ninja (12/12) Jan 24 2016 I tried looking for this in phobos but cant seem to find it which
- H. S. Teoh via Digitalmars-d-learn (9/11) Jan 24 2016 What kind of data do you need to write to file? If it's textual data,
- Tofu Ninja (3/15) Jan 24 2016 I am writing out binary data, so I guess I will just keep using
I tried looking for this in phobos but cant seem to find it which is really annoying. For my uses this works: struct fileOutRange { File f; void put(ubyte[] a) { f.rawWrite(a); } } But was just wondering if there was a real output range for files somewhere in phobos that I just cant seem to find.
Jan 24 2016
On Sun, Jan 24, 2016 at 12:38:22PM +0000, Tofu Ninja via Digitalmars-d-learn wrote:I tried looking for this in phobos but cant seem to find it which is really annoying. For my uses this works:What kind of data do you need to write to file? If it's textual data, use File.lockingTextWriter, which is an output range. If it's binary data, you'll probably have to roll your own; there's a Phobos PR right now that implements File.lockingBinaryWriter, but it's not quite ready for merging yet. T -- Real men don't take backups. They put their source on a public FTP-server and let the world mirror it. -- Linus Torvalds
Jan 24 2016
On Sunday, 24 January 2016 at 15:08:33 UTC, H. S. Teoh wrote:On Sun, Jan 24, 2016 at 12:38:22PM +0000, Tofu Ninja via Digitalmars-d-learn wrote:I am writing out binary data, so I guess I will just keep using what I am using.I tried looking for this in phobos but cant seem to find it which is really annoying. For my uses this works:What kind of data do you need to write to file? If it's textual data, use File.lockingTextWriter, which is an output range. If it's binary data, you'll probably have to roll your own; there's a Phobos PR right now that implements File.lockingBinaryWriter, but it's not quite ready for merging yet. T
Jan 24 2016