added: #recursiveRemoveAll
authorClaus Gittinger <cg@exept.de>
Tue, 25 Jan 2011 16:42:41 +0100
changeset 13246 3be09aea2c0f
parent 13245 6bb2fb9dc2b0
child 13247 9e47a0e73ba4
added: #recursiveRemoveAll
Filename.st
--- a/Filename.st	Mon Jan 24 21:39:47 2011 +0100
+++ b/Filename.st	Tue Jan 25 16:42:41 2011 +0100
@@ -2980,9 +2980,8 @@
     "Modified: / 5.5.1999 / 13:43:35 / cg"
 !
 
-recursiveRemoveWithoutOSCommand
-    "if I represent a regular file, remove it.
-     Otherwise, remove the directory and all of its subfiles/subdirectories.
+recursiveRemoveAll
+    "Otherwise, remove all of my subfiles/subdirectories.
      Raise an error if not successful.
      This one walks down the directory hierarchy, not using any OS
      command to do the remove."
@@ -3010,6 +3009,29 @@
             ].
         ]
     ].
+
+    "
+     'foo' asFilename makeDirectory.
+     'foo/bar' asFilename writeStream close.
+     'foo' asFilename remove
+    "
+    "
+     'foo' asFilename makeDirectory.
+     'foo/bar' asFilename writeStream close.
+     'foo' asFilename recursiveRemove
+    "
+
+    "Created: / 25-01-2011 / 16:42:15 / cg"
+!
+
+recursiveRemoveWithoutOSCommand
+    "if I represent a regular file, remove it.
+     Otherwise, remove the directory and all of its subfiles/subdirectories.
+     Raise an error if not successful.
+     This one walks down the directory hierarchy, not using any OS
+     command to do the remove."
+
+    self recursiveRemoveAll.
     self remove
 
     "
@@ -3023,8 +3045,8 @@
      'foo' asFilename recursiveRemove
     "
 
-    "Created: / 25.2.1998 / 19:50:40 / cg"
-    "Modified: / 25.2.1998 / 19:52:08 / cg"
+    "Created: / 25-02-1998 / 19:50:40 / cg"
+    "Modified: / 25-01-2011 / 16:42:24 / cg"
 !
 
 remove
@@ -5817,11 +5839,11 @@
 !Filename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.363 2011-01-12 09:45:36 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.364 2011-01-25 15:42:41 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.363 2011-01-12 09:45:36 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.364 2011-01-25 15:42:41 cg Exp $'
 ! !
 
 Filename initialize!