jecisc / Bazard

0 stars 0 forks source link

MemoryFileSysteFile shuold return a MultiByteFileStream as readStream #207

Closed jecisc closed 5 years ago

jecisc commented 5 years ago

Migrated case from Manuscript.

Original case: https://pharo.fogbugz.com/f/cases/20253 Status: Work Needed Project: Usability Original Author: CyrilFerlicot Date: 17 July 2017 9:59:16 am

Description:

/!\ I AM ABSOLUTLY NOT SURE OF WHAT I AM SAYING HERE

Currently MemoryFileSystemFile>>readStream return a ReadStream. This cause problem because I wanted to test file manipulation without making the image folder dirty. In the file manipulation I use #converter: implemented of the FileStreams. Thus, my tests are broken because in my tests I get a ReadStream.

Maybe a MemoryFileSystemFile should also return a MultiByteFileStream?

jecisc commented 5 years ago

Reply: Author: Guillermo Polito Date: 30 November 2017 9:34:46 am

Message:

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 ]. -=-=-

jecisc commented 5 years ago

Reply: Author: Juraj Kubelka Date: 30 November 2017 11:45:04 am

Message:

Maybe related

jecisc commented 5 years ago

Reply: Author: Pavel Krivanek Date: 1 October 2018 12:28:39 pm

Message:

MultiByteFileStream is deprecated. Is this issue still relevant?