Skip to content

File and output stream line ending compatibility changes#3430

Open
brgoing wants to merge 2 commits into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/o-binary-handling
Open

File and output stream line ending compatibility changes#3430
brgoing wants to merge 2 commits into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/o-binary-handling

Conversation

@brgoing
Copy link
Copy Markdown
Contributor

@brgoing brgoing commented Jun 5, 2026

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.

  • Introduces O_NVME_WRONLY, which includes O_BINARY when O_BINARY is defined, and updates file-open calls to use it.
  • Configures stdout and stderr to use O_BINARY on Windows

brgoing added 2 commits June 5, 2026 10:08
When opening files for writing, Windows requires the O_BINARY flag
for compatibility with behavior on other systems.  Otherwise it
translates line endings to \r\n.
Adds a flag for use when opening files for writing that includes
O_BINARY on Windows.

Signed-off-by: Broc Going <bgoing@micron.com>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant