This commit is contained in:
lz_db
2026-10-16 22:48:30 +08:00
parent 190de72571
commit 0b36fd3383
3161 changed files with 12787 additions and 77274 deletions
@@ -8,17 +8,16 @@ def windows_only(func):
@windows_only
def hide_file(path: str) -> None:
def hide_file(path):
"""
Set the hidden attribute on a file or directory.
From https://stackoverflow.com/questions/19622133/
From http://stackoverflow.com/questions/19622133/
`path` must be text.
"""
import ctypes
import ctypes.wintypes
__import__('ctypes.wintypes')
SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW
SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD
SetFileAttributes.restype = ctypes.wintypes.BOOL