Sha256: ccbe2bdd666304aa9ce261bf6a09a903acdd893c0c436181d2293859623004c9

Contents?: true

Size: 611 Bytes

Versions: 13

Compression:

Stored size: 611 Bytes

Contents

use crate::fs::{manually, FollowSymlinks, ImplMetadataExt, Metadata};
use rustix::fs::{statat, AtFlags};
use std::path::Path;
use std::{fs, io};

pub(crate) fn stat_impl(
    start: &fs::File,
    path: &Path,
    follow: FollowSymlinks,
) -> io::Result<Metadata> {
    if !super::beneath_supported() {
        return manually::stat(start, path, follow);
    }

    let flags = AtFlags::RESOLVE_BENEATH
        | if follow == FollowSymlinks::Yes {
            AtFlags::empty()
        } else {
            AtFlags::SYMLINK_NOFOLLOW
        };
    Ok(ImplMetadataExt::from_rustix(statat(start, path, flags)?))
}

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/cap-primitives-3.4.2/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-28.0.0 ./ext/cargo-vendor/cap-primitives-3.4.2/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-27.0.0 ./ext/cargo-vendor/cap-primitives-3.4.1/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-26.0.0 ./ext/cargo-vendor/cap-primitives-3.3.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-25.0.2 ./ext/cargo-vendor/cap-primitives-3.2.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-25.0.1 ./ext/cargo-vendor/cap-primitives-3.2.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-25.0.0 ./ext/cargo-vendor/cap-primitives-3.2.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-24.0.0 ./ext/cargo-vendor/cap-primitives-3.2.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-23.0.2 ./ext/cargo-vendor/cap-primitives-3.1.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-22.0.0 ./ext/cargo-vendor/cap-primitives-3.1.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-21.0.1 ./ext/cargo-vendor/cap-primitives-3.1.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-20.0.2 ./ext/cargo-vendor/cap-primitives-3.1.0/src/rustix/freebsd/fs/stat_impl.rs
wasmtime-20.0.0 ./ext/cargo-vendor/cap-primitives-3.0.0/src/rustix/freebsd/fs/stat_impl.rs