This commit is contained in:
jxxghp
2024-06-21 21:28:48 +08:00
parent e0a251b339
commit 37985eba25
8 changed files with 170 additions and 129 deletions

View File

@ -293,6 +293,25 @@ class SystemUtils:
return dirs
@staticmethod
def list_sub_all(directory: Path) -> List[Path]:
"""
列出当前目录下的所有子目录和文件(不递归)
"""
if not directory.exists():
return []
if directory.is_file():
return []
items = []
# 遍历目录
for path in directory.iterdir():
items.append(path)
return items
@staticmethod
def get_directory_size(path: Path) -> float:
"""