ZIPArchive usage + FileSystem memory
Hi, I can successfully use ZipArchive like the following -=-=- zip := ZipArchive new. { 'file1.txt'. 'file2.txt'. 'file3.txt' } do: [ :eachFile | | member | member := zip addString: eachFile, ' contents' as: eachFile. member desiredCompressionMethod: ZipArchive compressionDeflated ]. file := FileLocator temp / 'archive.zip'. zip writeTo: file writeStream. file. -=-=- What I should do to make it work while using FileSystem memory? -=-=- zip := ZipArchive new. { 'file1.txt'. 'file2.txt'. 'file3.txt' } do: [ :eachFile | | member | member := zip addString: eachFile, ' contents' as: eachFile. member desiredCompressionMethod: ZipArchive compressionDeflated ]. fileSystem := FileSystem memory. file := fileSystem root / 'archive.zip'. file writeStreamDo: [ :stream | zip writeTo: stream ]. -=-=- There is "Improper store into indexable objectâ as it tries to store a number in ByteString. Thanks! Juraj
Hi Juraj, The file streams opened in a memory file system are not polymorphic with the ones in a disk file system :(. Can you open an issue and assing it to me? I'll work soon on making all of them work and yield binary streams. On Wed, Nov 29, 2017 at 9:06 PM, Juraj Kubelka <juraj.kubelka@icloud.com> wrote:
Hi,
I can successfully use ZipArchive like the following
-=-=- zip := ZipArchive new. { 'file1.txt'. 'file2.txt'. 'file3.txt' } do: [ :eachFile | | member | member := zip addString: eachFile, ' contents' as: eachFile. member desiredCompressionMethod: ZipArchive compressionDeflated ]. file := FileLocator temp / 'archive.zip'. zip writeTo: file writeStream. file. -=-=-
What I should do to make it work while using FileSystem memory?
-=-=- zip := ZipArchive new. { 'file1.txt'. 'file2.txt'. 'file3.txt' } do: [ :eachFile | | member | member := zip addString: eachFile, ' contents' as: eachFile. member desiredCompressionMethod: ZipArchive compressionDeflated ]. fileSystem := FileSystem memory. file := fileSystem root / 'archive.zip'. file writeStreamDo: [ :stream | zip writeTo: stream ]. -=-=-
There is "Improper store into indexable objectâ as it tries to store a number in ByteString. Thanks! Juraj
-- Guille Polito Research Engineer Centre de Recherche en Informatique, Signal et Automatique de Lille CRIStAL - UMR 9189 French National Center for Scientific Research - *http://www.cnrs.fr <http://www.cnrs.fr>* *Web:* *http://guillep.github.io* <http://guillep.github.io> *Phone: *+33 06 52 70 66 13
On Thu, Nov 30, 2017 at 10:10 AM, Guillermo Polito < guillermopolito@gmail.com> wrote:
Hi Juraj,
The file streams opened in a memory file system are not polymorphic with the ones in a disk file system :(.
Can you open an issue and assing it to me? I'll work soon on making all of them work and yield binary streams.
Hi, In July I opened this issue: https://pharo.fogbugz.com/f/cases/20253/MemoryFileSysteFile-shuold-return-a-... If you open another one, you can close this one. Or maybe just rename this one with the stream class you intend to use.
--
Guille Polito
Research Engineer
Centre de Recherche en Informatique, Signal et Automatique de Lille
CRIStAL - UMR 9189
French National Center for Scientific Research - *http://www.cnrs.fr <http://www.cnrs.fr>*
*Web:* *http://guillep.github.io* <http://guillep.github.io>
*Phone: *+33 06 52 70 66 13 <+33%206%2052%2070%2066%2013>
-- Cyril Ferlicot https://ferlicot.fr http://www.synectique.eu 2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France
Thank you Guillermo. I see that you already assigned the case https://pharo.fogbugz.com/f/cases/20253/MemoryFileSysteFile-shuold-return-a-... Cheers, Juraj
On Nov 30, 2017, at 06:10, Guillermo Polito <guillermopolito@gmail.com> wrote:
Hi Juraj,
The file streams opened in a memory file system are not polymorphic with the ones in a disk file system :(.
Can you open an issue and assing it to me? I'll work soon on making all of them work and yield binary streams.
On Wed, Nov 29, 2017 at 9:06 PM, Juraj Kubelka <juraj.kubelka@icloud.com <mailto:juraj.kubelka@icloud.com>> wrote: Hi,
I can successfully use ZipArchive like the following
-=-=- zip := ZipArchive new. { 'file1.txt'. 'file2.txt'. 'file3.txt' } do: [ :eachFile | | member | member := zip addString: eachFile, ' contents' as: eachFile. member desiredCompressionMethod: ZipArchive compressionDeflated ]. file := FileLocator temp / 'archive.zip'. zip writeTo: file writeStream. file. -=-=-
What I should do to make it work while using FileSystem memory?
-=-=- zip := ZipArchive new. { 'file1.txt'. 'file2.txt'. 'file3.txt' } do: [ :eachFile | | member | member := zip addString: eachFile, ' contents' as: eachFile. member desiredCompressionMethod: ZipArchive compressionDeflated ]. fileSystem := FileSystem memory. file := fileSystem root / 'archive.zip'. file writeStreamDo: [ :stream | zip writeTo: stream ]. -=-=-
There is "Improper store into indexable objectâ as it tries to store a number in ByteString. Thanks! Juraj
--
Guille Polito Research Engineer
Centre de Recherche en Informatique, Signal et Automatique de Lille CRIStAL - UMR 9189 French National Center for Scientific Research - http://www.cnrs.fr <http://www.cnrs.fr/>
Web: http://guillep.github.io <http://guillep.github.io/> Phone: +33 06 52 70 66 13
participants (3)
-
Cyril Ferlicot -
Guillermo Polito -
Juraj Kubelka