[Pharo-users] Working with a compressed Fuel file?

Mariano Martinez Peck marianopeck at gmail.com
Sun Jan 3 14:31:56 EST 2016


I may have a hint. Which is the error upon materialization? A dnu on the
stream? Which message?
On Jan 3, 2016 4:19 PM, "Stephan Eggermont" <stephan at stack.nl> wrote:

> I'm trying to work with a compressed Fuel file, without having to expand
> everything at the same time. It looks like not all streams are created
> equally. I seem to need a File instead of a FileReference:
>
> saveToFile
>         |zipStream fileRef|
>         fileRef := File named: (FileSystem disk workingDirectory / (self
> fileName, '.zip')) pathString.
>         fileRef writeStreamDo: [ :s |
>                 zipStream := GZipWriteStream on: s.
>                 repository := nil.
>                 FLSerializer serialize: self on: zipStream.
>                 zipStream close].
>
>
> And materializing doesn't like this stream
>
> from: aFileName
>         |zipStream fileRef theNew|
>         fileRef := File named: aFileName.
>         fileRef readStreamDo: [ :s |
>                 zipStream := GZipReadStream on: s.
>                 theNew := (FLMaterializer new materializeFrom: zipStream)
> root.
>                 zipStream close].
>         ^theNew
>
> How am I supposed to work with compressed Fuel files?
>
> Stephan
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160103/1cf6c083/attachment.html>


More information about the Pharo-users mailing list