Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open file_reader on Windows in binary mode #3948

Closed
cretz opened this issue Nov 12, 2012 · 2 comments
Closed

Open file_reader on Windows in binary mode #3948

cretz opened this issue Nov 12, 2012 · 2 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. O-windows Operating system: Windows

Comments

@cretz
Copy link

cretz commented Nov 12, 2012

By default, you can't use io::file_reader on Windows where the file has byte 26 in the file because it is not opened in binary mode. It sees 26 and assumes EOF (or ctrl-Z or something). I noticed mk_file_writer uses O_BINARY as a flag on Windows. Can the io::file_reader function be changed to use binary mode? (I think this is just changing "r" to "rb" in the fopen flags).

Ref: http://cygwin.com/faq-nochunks.html#faq.api.cr-lf (as linked to from the mingw FAQ about O_BINARY here: http://www.mingw.org/wiki/FAQ)

@bstrie
Copy link
Contributor

bstrie commented Jun 6, 2013

This may very well be a one-character fix, but I don't have a version of Windows that can run Rust. Any volunteers?

@emberian
Copy link
Member

Still relevant, although all of that code is going to be torn out and replaced with the new runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

3 participants