filesizes: skip symlinks main
authortomás zerolo <tomas@tuxteam.de>
Sun, 20 Nov 2022 14:00:38 +0000 (15:00 +0100)
committertomás zerolo <tomas@tuxteam.de>
Sun, 20 Nov 2022 14:00:38 +0000 (15:00 +0100)
filesizes.py

index 893432ef0ca1090f301bb8bfdcb4c50cb0a640f3..69d29c9e565f20589e321137fa8c55534825a037 100755 (executable)
@@ -17,7 +17,8 @@ def collectdir(direc):
     exit(1)
 
   for it in direc.iterdir():
-    if os.access(it, os.R_OK): # ignore otherwise
+    if os.access(it, os.R_OK) and not it.is_symlink():
+      # ignore otherwise
       if it.is_file():
         sizes += [it.stat().st_size]
       elif it.is_dir():