[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Trouble with Marshal

Gavin Kistner

10/26/2006 9:16:00 PM

I'm trying to use Marshal on Windows to cache some results that take a
while to generate, and I'm getting some bad results.

Using the following simple code...
all = RANGE.map{ |i| `p4 describe -s #{i}` }
File.open( 'desc.marshal', 'w+' ){ |f| f << Marshal.dump(all) }
all = Marshal.load( IO.read( 'desc.marshal' ) )
...I can get different results depending on which range of changelists I
ask for.

Sometimes it's:
in `load': marshal data too short (ArgumentError)

Sometimes it's:
in `load': undefined class/module
/SpecToolClient/SpecToolClient/ApplicationData/Catalog_525_600-670/Optio
ns/Exterior_WindshieldRetainer/ (ArgumentError)

And sometimes it's:
This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.


I'm trying to pare it down to a simple test case. (Right now it's a 4MB
Marshal file.) As I do that, however...is there something obvious that
I'm doing wrong in the above code?