Trouble with Marshal

G

Gavin Kistner

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 =3D RANGE.map{ |i| `p4 describe -s #{i}` }
File.open( 'desc.marshal', 'w+' ){ |f| f << Marshal.dump(all) }
all =3D Marshal.load( IO.read( 'desc.marshal' ) )
...I can get different results depending on which range of changelists I
ask for.
=20
Sometimes it's:
in `load': marshal data too short (ArgumentError)
=20
Sometimes it's:
in `load': undefined class/module
/SpecToolClient/SpecToolClient/ApplicationData/Catalog_525_600-670/Optio
ns/Exterior_WindshieldRetainer/ (ArgumentError)=20
=20
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.

=20
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top