From: Sam Roberts Date: 2003-12-04T11:24:41+09:00 Subject: bug? ruby -e 's=File.stat("/");Marshal.dump(s);' Does nobody really care that this doesn't work? Is it that its fixed in 1.8, or something? ~/ruby $ ruby -e 's=File.stat("/");Marshal.dump(s);' -e:1:in `dump': can't dump File::Stat (TypeError) from -e:1 ~/ruby $ ruby -v ruby 1.6.7 (2002-03-01) [powerpc-darwin6.0] Sam Quoteing sroberts@uniserve.com, on Mon, Nov 03, 2003 at 05:20:01AM +0900: > Seems to be a long-standing oddity, discussed in ruby-talk #74175 and > #74162, but I still can't find a resolution to it. > > Still searching... > > Sam > > Quoteing sroberts@uniserve.com, on Sun, Nov 02, 2003 at 12:08:34PM +0900: > > Basically, I'm building a Hash of paths to their File::Stat, and > > Marshal.dumping it. Later I'll load it, and > > compare the current filesystem state to the state I saved. > > > > Simple, right? > > > > But, I can't marshall File::Stat, it's not allowed/supported. > > > > Irritating, but no problem, I'll build a Struct with all the values from > > the File::Stat that I want to save, and put that in the Hash instead, > > right? > > > > Well, that doesn't work so well, either. Now when I load that, I have > > no way to construct a File::Stat out of my own data (it lacks a "new"), > > and I lose all of File::Stats handy methods to see what kind of file it > > is, and its permissions, etc. > > > > Any suggestions? Can I define my own _load() and _dump() for File::Stat? > > Is that the right way? Am I not allowed to marshall File::Stat because > > its contents are system specific? > > > > Thanks for any pointers on how to deal with this, > > Sam > > > > >