#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Wed, 10 Oct 2018 20:56:05 +0200
changeset 18454 b4bea4fece8a
parent 18453 e20ac933ee00
child 18455 74f2616b1351
#REFACTORING by stefan class: DirectoryContentsBrowser changed: #diskUsageInKiloBytesFor: better use Filename>>#isRegularFile
DirectoryContentsBrowser.st
--- a/DirectoryContentsBrowser.st	Wed Oct 10 20:41:28 2018 +0200
+++ b/DirectoryContentsBrowser.st	Wed Oct 10 20:56:05 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2002 by eXept Software AG
               All Rights Reserved
@@ -2943,14 +2945,9 @@
     ].
 
     sum := 0.
-    aDirectory recursiveDirectoryContentsDo:[:fnString |
-        |fn|
-
-        fn := aDirectory construct:fnString.
-        fn isDirectory ifFalse:[
-            fn exists ifTrue:[     "/ cares for missing links in WinNT
-                sum := sum + fn fileSize
-            ].
+    aDirectory recursiveDirectoryContentsAsFilenamesDo:[:fn |
+        fn isRegularFile ifTrue:[
+            sum := sum + fn fileSize
         ].
     ].
     ^ sum / 1024