(
path: OsPath,
dir_fd: DirFd<'_, 0>,
mode: u32,
follow_symlinks: FollowSymlinks,
vm: &VirtualMachine,
)
| 1209 | } |
| 1210 | |
| 1211 | fn _chmod( |
| 1212 | path: OsPath, |
| 1213 | dir_fd: DirFd<'_, 0>, |
| 1214 | mode: u32, |
| 1215 | follow_symlinks: FollowSymlinks, |
| 1216 | vm: &VirtualMachine, |
| 1217 | ) -> PyResult<()> { |
| 1218 | let [] = dir_fd.0; |
| 1219 | let err_path = path.clone(); |
| 1220 | let body = move || { |
| 1221 | use std::os::unix::fs::PermissionsExt; |
| 1222 | let meta = fs_metadata(&path, follow_symlinks.0)?; |
| 1223 | let mut permissions = meta.permissions(); |
| 1224 | permissions.set_mode(mode); |
| 1225 | fs::set_permissions(&path, permissions) |
| 1226 | }; |
| 1227 | body().map_err(|err| OSErrorBuilder::with_filename(&err, err_path, vm)) |
| 1228 | } |
| 1229 | |
| 1230 | #[cfg(not(target_os = "redox"))] |
| 1231 | fn _fchmod(fd: BorrowedFd<'_>, mode: u32, vm: &VirtualMachine) -> PyResult<()> { |
no test coverage detected