(
path: Path,
*,
access: int,
share: int,
disposition: int,
flags: int,
missing_ok: bool = False,
)
| 278 | |
| 279 | |
| 280 | def _create_file( |
| 281 | path: Path, |
| 282 | *, |
| 283 | access: int, |
| 284 | share: int, |
| 285 | disposition: int, |
| 286 | flags: int, |
| 287 | missing_ok: bool = False, |
| 288 | ) -> _OwnedHandle | None: |
| 289 | _require_windows() |
| 290 | handle = _CreateFileW( |
| 291 | _extended_path(path), |
| 292 | access, |
| 293 | share, |
| 294 | None, |
| 295 | disposition, |
| 296 | flags, |
| 297 | None, |
| 298 | ) |
| 299 | if handle == _INVALID_HANDLE_VALUE: |
| 300 | error = ctypes.get_last_error() |
| 301 | if missing_ok and error in _MISSING_ERRORS: |
| 302 | return None |
| 303 | _raise_last_error("CreateFileW", path) |
| 304 | return _OwnedHandle(int(handle)) |
| 305 | |
| 306 | |
| 307 | def _attributes(handle: int) -> _FileAttributeTagInfo: |
no test coverage detected