Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Dec 19, 2024
1 parent 2f94674 commit dc54ec2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/admin/files/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def create_dir():
@panel_login_required
def get_dir_size():
path = request.form.get('path', '')
size = file.getDirSize(path)
size = file.getDirSizeByBash(path)
return mw.returnData(True, mw.toSize(size))


Expand Down
5 changes: 4 additions & 1 deletion web/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ def checkFileName(filename):
def getDirSize(filePath, size=0):
for root, dirs, files in os.walk(filePath):
for f in files:
size += os.path.getsize(os.path.join(root, f))
try:
size += os.path.getsize(os.path.join(root, f))
except Exception as e:
pass
# print(f)
return size

Expand Down

0 comments on commit dc54ec2

Please sign in to comment.