On Wed, Jun 20, 2012 at 12:55 PM, Mateusz Winiarski
<[email protected]> wrote:

> I'm saving using code:
> File.open(filename, "w") do |f|
>  f.write Marshal::dump(@map)
> end

You want binary mode. Plus, you can directly hand over the stream:

File.open(filename, 'wb') do |f|
 Marshal::dump(@map, f)
end

Cheers

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to