HCAI-Lab/w2-consensus-deepdive-unlearning-artifacts / pyright_venv /lib /python3.9 /site-packages /setuptools /windows_support.py
| import platform | |
| import ctypes | |
| def windows_only(func): | |
| if platform.system() != 'Windows': | |
| return lambda *args, **kwargs: None | |
| return func | |
| def hide_file(path): | |
| """ | |
| Set the hidden attribute on a file or directory. | |
| From http://stackoverflow.com/questions/19622133/ | |
| `path` must be text. | |
| """ | |
| __import__('ctypes.wintypes') | |
| SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW | |
| SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD | |
| SetFileAttributes.restype = ctypes.wintypes.BOOL | |
| FILE_ATTRIBUTE_HIDDEN = 0x02 | |
| ret = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) | |
| if not ret: | |
| raise ctypes.WinError() | |
Xet Storage Details
- Size:
- 714 Bytes
- Xet hash:
- ad75cb2b1bccb98a4bc29643c20dea4cc636e38dbb6516a69dd14849ae76994a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.