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 ! -- François Beausoleil http://blog.teksol.info/ http://piston.rubyforge.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I ran into this a while back. Here''s the patch I wrote. http://dev.rubyonrails.org/ticket/6380 -Jonathan. On 12/9/06, Francois Beausoleil <francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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 ! > -- > François Beausoleil > http://blog.teksol.info/ > http://piston.rubyforge.org/ > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Francois Beausoleil
2006-Dec-11 14:44 UTC
Fwd: [Rails] Re: [ANN] Windows Tempfile Fix Plugin
Hi, I think this patch needs applying. Could someone kindly take a look ? Thanks ! François ---------- Forwarded message ---------- From: Jonathan Viney <jonathan.viney@gmail.com> Date: 8 déc. 2006 17:05 Subject: [Rails] Re: [ANN] Windows Tempfile Fix Plugin To: rubyonrails-talk@googlegroups.com I ran into this a while back. Here's the patch I wrote. http://dev.rubyonrails.org/ticket/6380 -Jonathan. On 12/9/06, Francois Beausoleil <francois.beausoleil@gmail.com> wrote:> > 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 ! > -- > François Beausoleil > http://blog.teksol.info/ > http://piston.rubyforge.org/ > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---