‘Pharo.image' asFileReference 
        readStreamDo: [ :stream | (stream binary; next: 4) longAt: 1 bigEndian: 
false ].

> On 17 Dec 2015, at 13:26, Guillermo Polito <guillermopol...@gmail.com> wrote:
> 
> I’d prefer the new API that does not use MultiByteFileStream and friends :)
> 
> version := nil.
> (File named: 'Pharo.image') readStreamDo: [ :stream | 
>       version := (stream next: 4) longAt: 1 bigEndian: false ].
> version
> 
>> On 17 dic 2015, at 1:20 p.m., Stephan Eggermont <step...@stack.nl> wrote:
>> 
>> On 17-12-15 12:53, Guillermo Polito wrote:
>>> Hmm, usually an image file has a header that describes some meta data
>>> about the image: version, some VM options, size of the image…
>> 
>> byteStream := FileStream fileNamed: 
>> '/home/stephan/.local/share/Pharo/images/50305/50305.image'.
>> byteStream binary.
>> version := byteStream nextLittleEndianNumber: 4.
>> byteStream close.
>> version
>> 
>> 6505
>> 
>> That supports deciding which vm to use
>> 
>> Stephan
>> 
>> 
>> 
> 
> 


Reply via email to