优化examine_file方法,确保文件名和后缀匹配

This commit is contained in:
marques
2025-06-08 17:21:23 +08:00
parent cf1ad1d2df
commit 7b926cd25d

View File

@ -178,8 +178,8 @@ class PublicFunc:
@staticmethod
def examine_file(path_str, filename, suffix):
temp_path = list(
Path(path_str).glob(f"{filename}*"))
temp_path = [p for p in Path(path_str).glob(f"{filename}*") if p.stem.startswith(filename) and p.suffix == suffix]
if len(temp_path) == 0:
return Result().failure(
info=Constants.INPUT_FAILURE + "\n" +