Working with zipped files
Hi, by peeking around in "Deep into Pharo" I thought that | zf fr | fr := 'I:\SAS_Projekte\project.egp' asFileReference. zf := FileSystem zip: fr. zf store open. should be used to open a zip file programmatically. That fails with "ZnInvalidUTF8: Invalid utf8 input detected" Looking at MCMczReader, it skips the FileSystem API completely. In FileSystem-Tests-* I find DiskFileSystemTest and MemoryFileSystemTest, no ZipFileSystemTest to see how it's supposed to be done. Did I do it wrong? Or is FileSystem not yet "finalized" in that area? Best regards, Markus
Do you want to work with ZIP files, or specifically with MCZ ? 2014-12-09 15:03 GMT+03:00 Markus Fritsche <mfritsche@reauktion.de>:
Hi,
by peeking around in "Deep into Pharo" I thought that
| zf fr | fr := 'I:\SAS_Projekte\project.egp' asFileReference. zf := FileSystem zip: fr. zf store open.
should be used to open a zip file programmatically. That fails with "ZnInvalidUTF8: Invalid utf8 input detected"
Looking at MCMczReader, it skips the FileSystem API completely.
In FileSystem-Tests-* I find DiskFileSystemTest and MemoryFileSystemTest, no ZipFileSystemTest to see how it's supposed to be done.
Did I do it wrong? Or is FileSystem not yet "finalized" in that area?
Best regards, Markus
| zipArchive fileRef | zipArchive := ZipArchive new. fileRef := 'myFile.zip' asFileReference. [ zipArchive readFrom: fileRef fullName; extractAllTo: FileSystem workingDirectory ] ensure: [ zipArchive close ]. 2014-12-09 15:03 GMT-03:00 Markus Fritsche <mfritsche@reauktion.de>:
On 2014-12-09 18:19, ЮÑий ÐиÑоненко wrote:
Do you want to work with ZIP files, or specifically with MCZ ?
Just a zip file with a member called project.xml which I want to extract, change and rezip...
Best regards, Markus
On 2014-12-09 20:47, Hernán Morales Durand wrote:
| zipArchive fileRef | zipArchive := ZipArchive new. fileRef := 'myFile.zip' asFileReference. [ zipArchive readFrom: fileRef fullName; extractAllTo: FileSystem workingDirectory ] ensure: [ zipArchive close ].
Thank you!
General idea was to use ZipArchive instead of MCZ-related code. If above code fail to work for you, why not publish the file we are talking about? The it will be possible to test the code you are asking for. 2014-12-09 21:03 GMT+03:00 Markus Fritsche <mfritsche@reauktion.de>:
On 2014-12-09 18:19, ЮÑий ÐиÑоненко wrote:
Do you want to work with ZIP files, or specifically with MCZ ?
Just a zip file with a member called project.xml which I want to extract, change and rezip...
Best regards, Markus
On 2014-12-10 01:23, ЮÑий ÐиÑоненко wrote:
General idea was to use ZipArchive instead of MCZ-related code.
Sorry, I wasn't clear. MCZ was just my example. The real question was, if the ZipFileSystem API can be used or not... I will go with ZipArchive and friends then.
participants (3)
-
Hernán Morales Durand -
Markus Fritsche -
ЮÑий ÐиÑоненко