Bug 590 – std.stream has no way to create a text-mode file
Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-23T18:42:00Z
Last change time
2015-11-03T16:05:24Z
Assigned to
nobody
Creator
wbaxter
Comments
Comment #0 by wbaxter — 2006-11-23T18:42:40Z
Or perhaps this bug should be there's no binary mode 'din' and 'dout' because the inconsistency is really the problem.
The std.stream and std.cstream modules try to present a uniform interface to stream io. The problem is that C's FILE handles have a concept of text mode vs binary mode, and stdin and stdout C FILE streams are always text mode. However it is not possible to create a std.stream.File or BufferedFile in text mode.
Therefore if I want to write a stream function that consistently handles both stdio and file streams like:
write_some_text(OutputStream stream) {
stream.writef("\n");
}
this will give different output (on Windows) depending on whether stream is std.cstream.dout or a std.stream.BufferedFile.
Comment #1 by rburners — 2015-11-03T16:05:24Z
std.stream was deprecated and will be removed in 2016