Filename.st
branchjv
changeset 17912 80eb31a5a622
parent 17911 a99f15c5efa5
child 17938 e2aad1d7c317
--- a/Filename.st	Thu Jan 19 11:46:00 2012 +0000
+++ b/Filename.st	Sun Jan 22 23:07:15 2012 +0000
@@ -2855,56 +2855,6 @@
     "
 !
 
-new_recursiveRemoveAll
-    "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."
-
-    |files toRemove fileToRemove|
-
-    self isDirectory ifFalse:[^ self].
-    files := self directoryContentsAsFilenames.
-    files isEmpty ifTrue:[^ self].
-
-    toRemove := OrderedCollection new.
-    toRemove addAll:files.
-    [ toRemove notEmpty ] whileTrue:[
-        fileToRemove := toRemove removeLast.
-        Error handle:[:ex |
-            |children|
-
-            fileToRemove isDirectory ifTrue:[
-                children := fileToRemove directoryContentsAsFilenames.
-                children isEmpty ifTrue:[
-                    fileToRemove remove
-                ] ifFalse:[
-                    toRemove add:fileToRemove.
-                    toRemove addAll:children.
-                ].
-            ] ifFalse:[
-                ex reject 
-            ].
-        ] do:[
-            "/ Transcript showCR:('remove: ', fileToRemove pathName).
-            fileToRemove remove.
-        ].
-    ].
-
-    "
-     'foo' asFilename makeDirectory.
-     'foo/bar' asFilename writeStream close.
-     'foo' asFilename remove
-    "
-    "
-     'foo' asFilename makeDirectory.
-     'foo/bar' asFilename writeStream close.
-     'foo' asFilename recursiveRemove
-    "
-
-    "Created: / 11-10-2011 / 10:28:09 / cg"
-!
-
 recursiveCopyTo:destination
     "if I represent a regular file, copy it.
      Otherwise, copy the directory and recursively
@@ -3058,7 +3008,8 @@
                 f := self construct:aFilenameString.
                 Error handle:[:ex |
                     f isDirectory ifFalse:[ ex reject ].
-                    f recursiveRemoveWithoutOSCommand
+                    f recursiveRemoveAll.
+                    f removeDirectory
                 ] do:[
                     f remove
                 ].
@@ -3093,8 +3044,7 @@
      This one walks down the directory hierarchy, not using any OS
      command to do the remove."
 
-    self new_recursiveRemoveAll.
-    "/ self recursiveRemoveAll.
+    self recursiveRemoveAll.
     self remove
 
     "
@@ -3109,7 +3059,7 @@
     "
 
     "Created: / 25-02-1998 / 19:50:40 / cg"
-    "Modified: / 11-10-2011 / 10:29:20 / cg"
+    "Modified: / 19-01-2012 / 17:18:28 / cg"
 !
 
 remove
@@ -5929,15 +5879,15 @@
 !Filename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.372 2011/12/25 10:35:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.373 2012/01/19 16:20:58 cg Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/Filename.st,v 1.372 2011/12/25 10:35:01 cg Exp '
+    ^ 'Header: /cvs/stx/stx/libbasic/Filename.st,v 1.373 2012/01/19 16:20:58 cg Exp '
 !
 
 version_SVN
-    ^ '$Id: Filename.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: Filename.st 10763 2012-01-22 23:07:15Z vranyj1 $'
 ! !
 
 Filename initialize!
@@ -5945,3 +5895,4 @@
 
 
 
+