class: ZipArchive
authorStefan Vogel <sv@exept.de>
Fri, 08 Feb 2013 18:00:27 +0100
changeset 2895 b0b2598f105c
parent 2894 98072088e981
child 2896 1ce4144962d8
class: ZipArchive added: #flush changed: #closeFile
ZipArchive.st
--- a/ZipArchive.st	Mon Feb 04 13:14:52 2013 +0100
+++ b/ZipArchive.st	Fri Feb 08 18:00:27 2013 +0100
@@ -3238,6 +3238,18 @@
      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.
+    ]
+!
+
 name:name mode:readOrWriteMode
     "open read or writestream on archiveFileName"
 
@@ -3366,15 +3378,14 @@
 !
 
 closeFile
-    "close the stream - tell operating system"
+    "finish the zip archive and close the stream"
+
+    |savedFile|
 
     file notNil ifTrue:[
-        Lobby unregister:self.
-        mode == #write ifTrue: [
-            self addCentralZipDirectory
-        ].
-        file close.
-        file := nil.
+        savedFile := file.
+        self flush.
+        savedFile close.
     ]
 !
 
@@ -5155,11 +5166,12 @@
 !ZipArchive class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.102 2013-02-03 11:30:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.103 2013-02-08 17:00:27 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.102 2013-02-03 11:30:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.103 2013-02-08 17:00:27 stefan Exp $'
 ! !
 
+
 ZipArchive initialize!