How can I marshall File::Stat, and do file tests?

How can I marshall File::Stat, and do file tests?

Post by Sam Robert » Mon, 03 Nov 2003 12:08:34


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
 
 
 

How can I marshall File::Stat, and do file tests?

Post by Sam Robert » Tue, 04 Nov 2003 05:20:01

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 XXXX@XXXXX.COM , on Sun, Nov 02, 2003 at 12:08:34PM +0900: