(path: OsPath, mode: u8, vm: &VirtualMachine)
| 66 | |
| 67 | #[pyfunction] |
| 68 | pub(super) fn access(path: OsPath, mode: u8, vm: &VirtualMachine) -> PyResult<bool> { |
| 69 | let attr = unsafe { FileSystem::GetFileAttributesW(path.to_wide_cstring(vm)?.as_ptr()) }; |
| 70 | Ok(attr != FileSystem::INVALID_FILE_ATTRIBUTES |
| 71 | && (mode & 2 == 0 |
| 72 | || attr & FileSystem::FILE_ATTRIBUTE_READONLY == 0 |
| 73 | || attr & FileSystem::FILE_ATTRIBUTE_DIRECTORY != 0)) |
| 74 | } |
| 75 | |
| 76 | #[pyfunction] |
| 77 | #[pyfunction(name = "unlink")] |
nothing calls this directly
no test coverage detected