From d863a7cb7f727a15c9b5edc36f4f214f6d78c1cf Mon Sep 17 00:00:00 2001 From: wdmcheng Date: Wed, 30 Oct 2024 17:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20SystemUtils.list=5Ffiles?= =?UTF-8?q?=20=E9=81=8D=E5=8E=86=E7=9B=AE=E5=BD=95=E5=AF=B9=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E5=AD=97=E7=AC=A6=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7?= =?UTF-8?q?=EF=BC=88=E5=A6=82'[]'=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/system.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/utils/system.py b/app/utils/system.py index 961d71b4..5fd20363 100644 --- a/app/utils/system.py +++ b/app/utils/system.py @@ -193,8 +193,8 @@ class SystemUtils: pattern = r".*" # 遍历目录及子目录 - for matched_glob in glob(str(directory / '**'), recursive=recursive, include_hidden=True): - path = Path(matched_glob) + for matched_glob in glob('**', root_dir=directory, recursive=recursive, include_hidden=True): + path = directory.joinpath(matched_glob) if path.is_file() \ and re.match(pattern, path.name, re.IGNORECASE) \ and path.stat().st_size >= min_filesize * 1024 * 1024: @@ -229,8 +229,8 @@ class SystemUtils: pattern = r".*(" + "|".join(extensions) + ")$" # 遍历目录及子目录 - for matched_glob in glob(str(directory / '**'), recursive=recursive, include_hidden=True): - path = Path(matched_glob) + for matched_glob in glob('**', root_dir=directory, recursive=recursive, include_hidden=True): + path = directory.joinpath(matched_glob) if path.is_file() \ and re.match(pattern, path.name, re.IGNORECASE) \ and path.stat().st_size >= min_filesize * 1024 * 1024: