--- a/ZipArchive.st Tue May 06 14:12:38 2008 +0200
+++ b/ZipArchive.st Tue May 06 15:18:48 2008 +0200
@@ -2603,7 +2603,7 @@
f := aFileName asFilename.
f exists ifFalse:[^ false].
- f isDirectory ifFalse:[^ false].
+ f isDirectory ifTrue:[^ false].
fn := f pathName.
@@ -2826,8 +2826,17 @@
mode := readOrWriteMode.
mode ~~ #write ifTrue:[
+ |mustCloseFile|
+
+ mustCloseFile := true.
+
self openFile.
- self readDirectory.
+ [
+ self readDirectory.
+ mustCloseFile := false.
+ ] ensure:[
+ mustCloseFile ifTrue:[self closeFile].
+ ].
] ifFalse:[
self openFile.
].
@@ -2839,10 +2848,15 @@
|isValidArchive|
archiveName := archiveFileName asFilename name.
+ isValidArchive := false.
mode := #read.
self openFile.
- isValidArchive := self checkZipArchive.
- self closeFile.
+
+ [
+ isValidArchive := self checkZipArchive.
+ ] ensure:[
+ self closeFile.
+ ].
^ isValidArchive
!
@@ -3767,7 +3781,7 @@
!ZipArchive class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.59 2008-05-06 12:12:38 ab Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.60 2008-05-06 13:18:48 ca Exp $'
! !
ZipArchive initialize!