Sha256: 4cccbe84b98900c607c0faa5cfe39b88b1b6246d44d76bfb53895ebb51605a76

Contents?: true

Size: 535 Bytes

Versions: 6

Compression:

Stored size: 535 Bytes

Contents

use crate::fs::Permissions;
use rustix::fs::{chmodat, AtFlags, Mode};
use std::os::unix::fs::PermissionsExt;
use std::path::Path;
use std::{fs, io};

pub(crate) fn set_permissions_impl(
    start: &fs::File,
    path: &Path,
    perm: Permissions,
) -> io::Result<()> {
    if !super::beneath_supported() {
        return super::super::super::fs::set_permissions_manually(start, path, perm);
    }

    Ok(chmodat(
        start,
        path,
        Mode::from_raw_mode(perm.mode() as _),
        AtFlags::RESOLVE_BENEATH,
    )?)
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wasmtime-18.0.3 ./ext/cargo-vendor/cap-primitives-2.0.1/src/rustix/freebsd/fs/set_permissions_impl.rs
wasmtime-17.0.1 ./ext/cargo-vendor/cap-primitives-2.0.1/src/rustix/freebsd/fs/set_permissions_impl.rs
wasmtime-17.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/rustix/freebsd/fs/set_permissions_impl.rs
wasmtime-16.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/rustix/freebsd/fs/set_permissions_impl.rs
wasmtime-15.0.1 ./ext/cargo-vendor/cap-primitives-2.0.1/src/rustix/freebsd/fs/set_permissions_impl.rs
wasmtime-15.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/rustix/freebsd/fs/set_permissions_impl.rs