Win32 code to test whether the given file has the hidden property set.
(filepath)
| 140 | |
| 141 | |
| 142 | def has_hidden_attribute(filepath): |
| 143 | """Win32 code to test whether the given file has the hidden property set.""" |
| 144 | if sys.platform != 'win32': |
| 145 | return False |
| 146 | |
| 147 | try: |
| 148 | attrs = ctypes.windll.kernel32.GetFileAttributesW(filepath) |
| 149 | assert attrs != -1 |
| 150 | result = bool(attrs & 2) |
| 151 | except Exception: |
| 152 | result = False |
| 153 | return result |
| 154 | |
| 155 | |
| 156 | def should_ignore(fullname): |