Hi,
while using the Rails web framework, I came across an
issue with ruby/lib/pstore.rb. Rails uses the PStore class
to store (binary) session data, but Ruby's PStore doesn't
set its streams to binmode.
On Windows this causes PStore to corrupt the binary
session data.
I also posted about the issue to
The people in #rubyonrails asked me to post a note to
ruby-talk about this issue.
Bye, Henning
···
--
Henning Koch
http://www.paws.cx
Hi,
On Windows this causes PStore to corrupt the binary
session data.
I also posted about the issue to
Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.
The people in #rubyonrails asked me to post a note to
ruby-talk about this issue.
I have no machine that requires "binmode". Does this patch work for
you?
matz.
--- lib/pstore.rb 1 Jul 2004 09:31:37 -0000 1.21
+++ lib/pstore.rb 4 Oct 2004 23:20:53 -0000
@@ -101,2 +101,3 @@ class PStore
file = File.open(@filename, File::RDWR | File::CREAT)
+ file.binmode
file.flock(File::LOCK_EX)
@@ -106,2 +107,3 @@ class PStore
file = File.open(@filename, File::RDONLY)
+ file.binmode
file.flock(File::LOCK_SH)
···
In message "Re: pstore.rb not operating in binmode" on Tue, 5 Oct 2004 06:12:07 +0900, Henning Koch <henning.koch@gmx.net> writes:
That's probably the reason I had Instiki failing big-time when running
it under Cygwin. (Binary/non-binary data is often a problem there, as
the directory you're in could be set to use either by default.)
Gavin
···
On Tuesday, October 5, 2004, 7:12:07 AM, Henning wrote:
Hi,
while using the Rails web framework, I came across an
issue with ruby/lib/pstore.rb. Rails uses the PStore class
to store (binary) session data, but Ruby's PStore doesn't
set its streams to binmode.
On Windows this causes PStore to corrupt the binary
session data.
I also posted about the issue to
Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.
The people in #rubyonrails asked me to post a note to
ruby-talk about this issue.
Henning Koch ha scritto:
The people in #rubyonrails asked me to post a note to
ruby-talk about this issue.
that means me 
I have this feeling that this thing may have been fixed long time ago.. and somewhat reverted.
NOw I wonder: why can't we handle this at the interpreter level?
I mean, adding instead of asking people to add a 'b' every time, changing windows' file opening calls so that it is included by default.
there is some reason to open files not in binmode?
there is some reason to open files not in binmode?
Susbstitution of \r\n with \n afaik