From: Mike Harris Date: 2006-07-29T03:11:28+09:00 Subject: Re: Mongoose 0.2.5 - The "Two Steps Forward, One Step Back" release Daniel Berger wrote: > Jamey Cribbs wrote: > >> Logan Capaldo wrote: >> >>>> >>> I'm pretty sure this is a case of Jamey being lazy (no offense Jamey >>> ). I just did a quick grep for open in the source, he doesn't >>> tack on 'b' to his flags (when he almost certainly should when >>> storing binary data like a Marshaled string.) Let me guess, you are >>> on Windows, right? Hence the magical \r -> to \r\n transformation. >> >> Oops! Guilty as charged. Ever since I switched to Ubuntu, the only >> time I boot into Windows is to play games, so I obviously haven't >> tested this much under Windows! >> >> Thanks for catching this Logan. I'll make sure I add the 'b' flag >> for the next release. > > > I wonder if we need to revisit the issue of making binmode the > default. I don't see a downside, really. The only thing I can think > of is that some Win32 API functions used through win32api or win32ole > might get confused, but I doubt it. > > Regards, > > Dan > > > > This communication is the property of Qwest and may contain > confidential or > privileged information. Unauthorized use of this communication is > strictly prohibited and may be unlawful. If you have received this > communication in error, please immediately notify the sender by reply > e-mail and destroy all copies of the communication and any attachments. > > Yup, when you add the b flag, it works (mostly) obj.foo = (1..9).to_a still doesn't work. When you try and read it back, you get 1 (a Fixnum). obj.foo = Marshal.dump((1..9).to_a) does work. Obviously you have to Marshal.load on retrieval, but it works. Awesome. I'm going to add an :object type and transparent-ize the marshalling.