Hello, I'm looking through the File API at http://doc.rust-lang.org/std/io/ and I don't see a way to open a file in binary-mode vs text-mode. It seems the default is binary mode from tests that I've done. AFAIK, this only matters on Windows since a carriage return would not be returned to the program in text-mode on Windows.
It seems like FileAccess and FileMode are used to provide similar flags to libc as are provided to fopen http://www.cplusplus.com/reference/cstdio/fopen/ . I'm looking at an implementation of md5sum in rust, but it doesn't have a "text" option (equivalent fopen with mode "r" rather than "rb") that can be implemented without using libc directly as far as I can tell. Is there a way to do this with Rust? If not, adding a flag would be useful for text file-writing/reading when running on Windows, but it could also be a source of issues for people trying to write binary/text data depending on the defaults. Any thoughts on this? Thanks, Gil Cottle
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev