Windows Tempfile Fix Plugin

Hi all,

Yesterday, I had some problems reading JPG files in my tests. Turns out the problem was that Windows Ruby doesn't set it's Tempfile to work in binary mode. Since I deploy on Linux, that has never been a big problem, but now I'm working on some software that works with binary files exclusively.

Anyway, I am making this fix available as a Rails plugin.

The details can be found here: http://blog.teksol.info/articles/2006/12/08/windows-tempfile-fix-plugin

If you'd prefer patching your Ruby, the fix is in tempfile.rb:55. Or File::BINARY to the other constants in the File#open call.

Enjoy !

I ran into this a while back. Here’s the patch I wrote.

http://dev.rubyonrails.org/ticket/6380

-Jonathan.

Hi,

I think this patch needs applying. Could someone kindly take a look ?

Thanks ! François