MCPcopy Index your code
hub / github.com/RustPython/RustPython / GetFileType

Function GetFileType

crates/vm/src/stdlib/_winapi.rs:212–222  ·  view source on GitHub ↗
(
        h: WinHandle,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

210
211 #[pyfunction]
212 fn GetFileType(
213 h: WinHandle,
214 vm: &VirtualMachine,
215 ) -> PyResult<windows_sys::Win32::Storage::FileSystem::FILE_TYPE> {
216 let file_type = unsafe { windows_sys::Win32::Storage::FileSystem::GetFileType(h.0) };
217 if file_type == 0 && unsafe { windows_sys::Win32::Foundation::GetLastError() } != 0 {
218 Err(vm.new_last_os_error())
219 } else {
220 Ok(file_type)
221 }
222 }
223
224 #[pyfunction]
225 fn GetLastError() -> u32 {

Callers 4

fstatFunction · 0.85
win32_xstat_slow_implFunction · 0.85
_test_file_existsFunction · 0.85

Calls 3

new_last_os_errorMethod · 0.80
GetLastErrorFunction · 0.70
ErrClass · 0.50

Tested by

no test coverage detected