On 2/27/14 2:54 PM, Mariano Martinez Peck wrote:



On Thu, Feb 27, 2014 at 10:48 AM, Lorenzo Baracchi <[email protected] <mailto:[email protected]>> wrote:

    Hi

    I was using FLMaterializer materializationFromFileNamed: filename
    to read fuel files.
    Until yesterday everything was fine, but today I updated Pharo and
    received the error "'Materialization error. Unexpected stream
    version 19 where it should be 193."

    I guess that a new version of fuel cannot (simply) read old
    versions files.


This is the "default" exception. But maybe....between 1.9 and 1.9.2 the file format didn't change. Max?

    Is there a way to  know in which version of fuel a file was
    written and use that version to read it?


In the exception message itself. "'Materialization error. Unexpected stream version 19 where it should be 193." It says that in the current stream the version is 19 but the code now expects 193. So you should load Fuel 1.9 to materialize those files.
so far so good.

My goal was more about trying to avoid that error. Like asking to the FLMaterializer (or other) which version does a file have and then load the correspondent version of fuel.
For example:
    version := FLMaterializer getVersionOfFileNamed: filename.
    (ConfigurationOfFuel project version: version ) load.
    materializerClass := Smalltalk at: #FLMaterializer.
    ^materializerClass materializationFromFileNamed: filename.

Best,


    thanks
        Lorenzo




--
Mariano
http://marianopeck.wordpress.com

Reply via email to