--- a/FileDir.st Sun Dec 12 22:29:51 1993 +0100
+++ b/FileDir.st Sun Dec 12 22:30:47 1993 +0100
@@ -26,7 +26,7 @@
They provide various methods to create/delete and query for files and/or
directories.
-$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.5 1993-12-11 00:47:59 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.6 1993-12-12 21:30:47 claus Exp $
written winter 89 by claus
'!
@@ -283,12 +283,19 @@
!
removeDirectory:dirName
- "remove the directory 'dirName' from myself; return true if successful"
+ "remove the directory 'dirName' from myself; return true if successful.
+ If the directory is not empty, the containign files/directories are also
+ removed."
+
+ |absPath|
(dirName startsWith:'/') ifTrue:[
- ^ OperatingSystem removeDirectory:dirName
+ absPath := dirName
+ ] ifFalse:[
+ absPath := pathName , '/' , dirName
].
- ^ OperatingSystem removeDirectory:(pathName , '/' , dirName)
+ (OperatingSystem removeDirectory:absPath) ifTrue:[^ true].
+ ^ OperatingSystem recursiveRemoveDirectory:absPath
!
remove:aFileOrDirectoryName
--- a/FileDirectory.st Sun Dec 12 22:29:51 1993 +0100
+++ b/FileDirectory.st Sun Dec 12 22:30:47 1993 +0100
@@ -26,7 +26,7 @@
They provide various methods to create/delete and query for files and/or
directories.
-$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.5 1993-12-11 00:47:59 claus Exp $
+$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.6 1993-12-12 21:30:47 claus Exp $
written winter 89 by claus
'!
@@ -283,12 +283,19 @@
!
removeDirectory:dirName
- "remove the directory 'dirName' from myself; return true if successful"
+ "remove the directory 'dirName' from myself; return true if successful.
+ If the directory is not empty, the containign files/directories are also
+ removed."
+
+ |absPath|
(dirName startsWith:'/') ifTrue:[
- ^ OperatingSystem removeDirectory:dirName
+ absPath := dirName
+ ] ifFalse:[
+ absPath := pathName , '/' , dirName
].
- ^ OperatingSystem removeDirectory:(pathName , '/' , dirName)
+ (OperatingSystem removeDirectory:absPath) ifTrue:[^ true].
+ ^ OperatingSystem recursiveRemoveDirectory:absPath
!
remove:aFileOrDirectoryName