Fix errors in file size for properties window

When getting the size of directory, the function now skips symlinks to prevernt errors
This commit is contained in:
heliguy
2023-09-02 02:54:31 -04:00
parent 0c60d993cd
commit 571221b4bd

View File

@@ -90,6 +90,8 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
try:
# print("[+] Getting the size of", directory)
for entry in os.scandir(directory):
if entry.is_symlink():
continue # Skip symlinks
if entry.is_file():
# if it's a file, use stat() function
total += entry.stat().st_size