| 186 | } |
| 187 | |
| 188 | bool File::hasWriteAccess() const |
| 189 | { |
| 190 | if (fullPath.isEmpty()) |
| 191 | return true; |
| 192 | |
| 193 | auto attr = WindowsFileHelpers::getAtts (fullPath); |
| 194 | |
| 195 | // NB: According to MS, the FILE_ATTRIBUTE_READONLY attribute doesn't work for |
| 196 | // folders, and can be incorrectly set for some special folders, so we'll just say |
| 197 | // that folders are always writable. |
| 198 | return attr == INVALID_FILE_ATTRIBUTES |
| 199 | || (attr & FILE_ATTRIBUTE_DIRECTORY) != 0 |
| 200 | || (attr & FILE_ATTRIBUTE_READONLY) == 0; |
| 201 | } |
| 202 | |
| 203 | bool File::setFileReadOnlyInternal (bool shouldBeReadOnly) const |
| 204 | { |
no test coverage detected