File and output stream line ending compatibility changes#3430
Conversation
|
I don't like this approach with overloading of the flags flags. The resulting code doesn't read well. What about introducing something like |
Okay. Thank you for the feedback. We discussed multiple approaches to this, including defining O_BINARY as 0 on Linux and including it in the flags used, introducing a new nvme_open method like you mentioned, or the modified O_WRONLY approach we went with in this PR. Each had its own drawbacks, so we figured we needed to pick one and go with it to start the conversation. |
2470c5b to
984ecdf
Compare
When opening raw data files, Windows requires the O_BINARY flag for compatibility with behavior on other systems. Otherwise it translates \n line endings to \r\n. Adds a wrapper for use when opening raw data files that adds O_BINARY if defined. Signed-off-by: Broc Going <bgoing@micron.com>
984ecdf to
a950218
Compare
Sets O_BINARY for stderr and stdout for output compatibility on Windows. Prevents Windows from converting line endings from LF to CRLF. Signed-off-by: Broc Going <bgoing@micron.com>
Makes Windows output behavior match other platforms by using O_BINARY to prevent text-mode line ending translation (LF to CRLF) that can corrupt binary output.