This commit is contained in:
ton
2024-10-07 10:13:40 +07:00
parent aa1631742f
commit 3a7d696db6
9729 changed files with 1832837 additions and 161742 deletions

View File

@@ -8,17 +8,17 @@ def windows_only(func):
@windows_only
def hide_file(path):
def hide_file(path: str) -> None:
"""
Set the hidden attribute on a file or directory.
From http://stackoverflow.com/questions/19622133/
From https://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