Skip to content

Commit

Permalink
Don't check the UF_HIDDEN flag on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Oct 8, 2024
1 parent 8e30278 commit d74bd20
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/split_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,13 @@ def is_user_file(path: "StrPath"):
if os.path.isdir(path) or os.path.basename(path).startswith("."):
return False
stat_result = os.stat(path)
if stat_result.st_mode & UF_HIDDEN:
return False
if sys.platform == "win32":
return not (
(stat_result.st_file_attributes & FILE_ATTRIBUTE_SYSTEM)
| (stat_result.st_file_attributes & FILE_ATTRIBUTE_HIDDEN)
)
return True
# UF_HIDDEN is present on regular Windows files
return not stat_result.st_mode & UF_HIDDEN


def __get_images_from_directory(directory: "StrPath"):
Expand Down

0 comments on commit d74bd20

Please sign in to comment.