#FEATURE by stefan
authorStefan Vogel <sv@exept.de>
Wed, 12 Sep 2018 18:52:42 +0200
changeset 23332 92a3564b47ab
parent 23331 0bf0201d8ac0
child 23333 56e0a0217ffb
#FEATURE by stefan class: Filename added: #isEmptyDirectory
Filename.st
--- a/Filename.st	Wed Sep 12 12:31:38 2018 +0200
+++ b/Filename.st	Wed Sep 12 18:52:42 2018 +0200
@@ -6172,6 +6172,22 @@
     "Modified: / 21.9.1998 / 15:33:07 / cg"
 !
 
+isEmptyDirectory
+    "answer true, if this is an empty directory.
+     Raise an exception, if this is not a directory."
+
+    self directoryContentsDo:[:each | ^ false].
+    ^ true
+
+    "
+     '.' asFilename isEmptyDirectory
+     'Make.proto' asFilename isEmptyDirectory
+     '/XXXdoesNotExist' asFilename isEmptyDirectory
+    "
+
+    "Created: / 12-09-2018 / 14:29:12 / Stefan Vogel"
+!
+
 recursiveDirectoryContents
     "return the contents of the directory and all subdirectories
      as a collection of strings.