From: noreply@... Date: 2005-07-14T16:35:27+09:00 Subject: [ ruby-Bugs-2101 ] bug in pstore (ruby 1.8.2) on Windows ( Win XP) ? Bugs item #2101, was opened at 2005-07-14 15:30 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=2101&group_id=426 Category: Standard Library Group: None Status: Open Resolution: None Priority: 3 Submitted By: Kelvin Cheng (kfchengkf) Assigned to: Nobody (None) Summary: bug in pstore (ruby 1.8.2) on Windows ( Win XP) ? Initial Comment: The follow error occurs c:/ruby/lib/ruby/1.8/pstore.rb:163:in `load': marshal data too short (ArgumentError) when this code is run: #################################### require "pstore" id = 21 pstore = PStore.new("c:/testfile") pstore.transaction do pstore["id"] = id end pstore.transaction do id = pstore["id"] end print id, "\n" ################################### The code is run on WinXP ruby version is 1.8.2 Solution: I have to change pstore.rb line 101 from file = File.open(@filename, File::RDWR | File::CREAT) to file = File.open(@filename, "a+b") to solve this problem ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=2101&group_id=426