# IO#read mode on Windows

**URL:** <https://www.ruby-forum.com/t/io-read-mode-on-windows/63185>\
**Category:** Ruby\
**Created:** [June 13, 2006, 12:54am UTC](https://www.ruby-forum.com/t/io-read-mode-on-windows/63185 "2006-06-13T00:54:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [June 13, 2006, 12:54am UTC](https://www.ruby-forum.com/t/io-read-mode-on-windows/63185/1 "2006-06-13T00:54:27Z")

</div>

Hi all,

Is there any way to set the default read/write mode for IO on Windows?  
I’ve just had a fairly nasty little bug come up where  
File.read(‘filename’) != File.open(‘filename’, ‘rb’){|f| f.read}, so  
partial files were being read.

Are there any circumstances where it makes a practical difference (from  
Ruby’s point of view) which mode a file’s opened in?
