deletion of an old *.sav file fixed
authorboris
Fri, 08 Dec 2006 10:46:25 +0100
changeset 1795 e52a638e2a81
parent 1794 603885d999ca
child 1796 6c3fbed5ff78
deletion of an old *.sav file fixed
Archiver.st
--- a/Archiver.st	Thu Dec 07 17:54:01 2006 +0100
+++ b/Archiver.st	Fri Dec 08 10:46:25 2006 +0100
@@ -479,7 +479,7 @@
 !Archiver::MultiFileArchive methodsFor:'actions'!
 
 addFilesToArchive:colOfFiles
-    |cmd tempDir archivFile archivInTemp fileSize |
+    |cmd tempDir archivFile archivInTemp fileSize backupFile|
 
     archivFile := self fileName.
 
@@ -493,9 +493,13 @@
 
     "/ keep a save copy
 
-    (archivFile withSuffix: 'sav') exists
-        ifTrue: [(archivFile withSuffix: 'sav') remove].
+    backupFile := archivFile withSuffix: 'sav'.
+    (backupFile exists) ifTrue:[
+          backupFile recursiveRemove. " works for a file as well as for a directory " 
+    ].
+
     archivFile renameTo:(archivFile withSuffix:'sav').
+
     [
         "/ copy files to be added to tempDir
         colOfFiles do:[:file | | destName |
@@ -1287,7 +1291,7 @@
 !Archiver class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Archiver.st,v 1.29 2006-11-27 13:56:36 boris Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Archiver.st,v 1.30 2006-12-08 09:46:25 boris Exp $'
 ! !
 
 Archiver initialize!