On 2/27/14 2:54 PM, Mariano Martinez
Peck wrote:
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.
That�s an interesting idea!
Will mostly not work though because the new versions often compensate for platform development. That means that older versions of Fuel will not correctly work with Pharo3 for instance because they don�t know about Opal etc.
Still, I think it�s a nice idea to be able to ask for the version of a Fuel file. I�ll open an issue for that.
At the moment the version is encoded after the signature right at the beginning of the file and is not part of any special object that is materialized. Therefore, you best option is to read the first few bytes of the file and decode them manually as they would be with FLDecoder>>nextEncodedUint16.
Cheers,
Max