From: Michael Campbell Date: 2003-06-23T22:10:38+09:00 Subject: Re: Marshal bug? --- Dave Thomas wrote: > Anders Borch wrote: > > Hi! > > > > why is this happening to me: > > > > $ irb > > irb(main):001:0> a=File.new('somefile','r') > ^^ read-only file > > => # > > irb(main):002:0> Marshal.dump(a.stat) > > TypeError: can't dump File::Stat > > from (irb):2:in `dump' > > from (irb):2 > > irb(main):003:0> Maybe I misread, but I think he was asking why a.stat instance couldn't be marshalled, not why you couldn't marshal to the file referenced by 'a', no? Changing 'r' to 'w' above anyway yields (for me): bash-2.05b$ cat tmp.rb a=File.new('somefile','w') Marshal.dump(a.stat) bash-2.05b$ ruby -v ruby 1.8.0 (2003-05-26) [i386-mswin32] bash-2.05b$ ruby tmp.rb tmp.rb:2:in `dump': class File::Stat needs to have instance method `_dump_data' (TypeError) from tmp.rb:2 __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com