--- a/ZipArchive.st Sat Oct 15 06:56:28 2016 +0200
+++ b/ZipArchive.st Wed Oct 19 06:53:17 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1998 by eXept Software AG
All Rights Reserved
@@ -3268,18 +3270,18 @@
!ZipArchive methodsFor:'open & close'!
close
- self closeFile
+ file notNil ifTrue:[
+ self flush.
+ Lobby unregister:self.
+ self closeFile.
+ ]
!
flush
"finish the zip archive, but do not close the underlying stream"
- file notNil ifTrue:[
- Lobby unregister:self.
- mode == #write ifTrue: [
- self addCentralZipDirectory
- ].
- file := nil.
+ (file notNil and:[mode == #write]) ifTrue: [
+ self addCentralZipDirectory
]
!
@@ -3297,7 +3299,7 @@
].
file notNil ifTrue: [
- self closeFile.
+ self close.
].
archiveName := filename name.
@@ -3323,7 +3325,7 @@
mode := #write.
].
] ensure:[
- mustCloseFile ifTrue:[self closeFile].
+ mustCloseFile ifTrue:[self close].
].
] ifFalse:[
zipMembersByName := Dictionary new.
@@ -3346,7 +3348,7 @@
file notNil ifTrue: [
file ~~ aPositionableStream ifTrue: [
- self closeFile.
+ self close.
].
].
@@ -3380,7 +3382,7 @@
"initialize the archive to write to aPositionableStream"
file notNil ifTrue: [
- self closeFile.
+ self close.
].
mode := #write.
@@ -3403,7 +3405,7 @@
file notNil ifTrue:[
savedFile := file.
- self flush.
+ file := nil.
savedFile close.
]
!
@@ -3792,7 +3794,7 @@
[
isValidArchive := self checkZipArchive.
] ensure:[
- self closeFile.
+ self close.
].
^ isValidArchive
!
@@ -4000,7 +4002,6 @@
^ false.
! !
-
!ZipArchive methodsFor:'reading'!
extract:fileName
@@ -4110,7 +4111,6 @@
"Created: / 21-11-2010 / 11:51:41 / cg"
! !
-
!ZipArchive methodsFor:'reading - stream'!
extract:fileName intoStream: aWriteStream