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

Function fchmod_impl

crates/vm/src/stdlib/nt.rs:319–325  ·  view source on GitHub ↗
(fd: i32, mode: u32, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

317 }
318
319 fn fchmod_impl(fd: i32, mode: u32, vm: &VirtualMachine) -> PyResult<()> {
320 // Get Windows HANDLE from fd
321 let borrowed = unsafe { crt_fd::Borrowed::borrow_raw(fd) };
322 let handle = crt_fd::as_handle(borrowed).map_err(|e| e.to_pyexception(vm))?;
323 let hfile = handle.as_raw_handle() as Foundation::HANDLE;
324 win32_hchmod(hfile, mode, vm)
325 }
326
327 fn win32_lchmod(path: &OsPath, mode: u32, vm: &VirtualMachine) -> PyResult<()> {
328 use windows_sys::Win32::Storage::FileSystem::{GetFileAttributesW, SetFileAttributesW};

Callers 2

fchmodFunction · 0.85
chmodFunction · 0.85

Calls 3

as_handleFunction · 0.85
win32_hchmodFunction · 0.85
to_pyexceptionMethod · 0.45

Tested by

no test coverage detected