Sha256: 54ed0e77db3d7e141e2c0354de6dd0e2fbc3f52181415e83f48079ce5e30bba3

Contents?: true

Size: 491 Bytes

Versions: 36

Compression:

Stored size: 491 Bytes

Contents

use io_lifetimes::AsHandle;
use std::{fs, io};

pub(crate) fn is_file_read_write_impl(file: &fs::File) -> io::Result<(bool, bool)> {
    let handle = file.as_handle();
    let access_mode = winx::file::query_access_information(handle)?;
    let read = access_mode.contains(winx::file::AccessMode::FILE_READ_DATA);
    let write = access_mode.contains(winx::file::AccessMode::FILE_WRITE_DATA)
        || access_mode.contains(winx::file::AccessMode::FILE_APPEND_DATA);
    Ok((read, write))
}

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
wasmtime-27.0.0 ./ext/cargo-vendor/cap-primitives-3.4.1/src/windows/fs/is_file_read_write_impl.rs
wasmtime-26.0.0 ./ext/cargo-vendor/cap-primitives-3.3.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-25.0.2 ./ext/cargo-vendor/cap-primitives-3.2.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-25.0.1 ./ext/cargo-vendor/cap-primitives-3.2.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-25.0.0 ./ext/cargo-vendor/cap-primitives-3.2.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-24.0.0 ./ext/cargo-vendor/cap-primitives-3.2.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-23.0.2 ./ext/cargo-vendor/cap-primitives-3.1.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-22.0.0 ./ext/cargo-vendor/cap-primitives-3.1.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-21.0.1 ./ext/cargo-vendor/cap-primitives-3.1.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-20.0.2 ./ext/cargo-vendor/cap-primitives-3.1.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-20.0.0 ./ext/cargo-vendor/cap-primitives-3.0.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-18.0.3 ./ext/cargo-vendor/cap-primitives-2.0.1/src/windows/fs/is_file_read_write_impl.rs
wasmtime-17.0.1 ./ext/cargo-vendor/cap-primitives-2.0.1/src/windows/fs/is_file_read_write_impl.rs
wasmtime-17.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/windows/fs/is_file_read_write_impl.rs
wasmtime-16.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/windows/fs/is_file_read_write_impl.rs
wasmtime-15.0.1 ./ext/cargo-vendor/cap-primitives-2.0.1/src/windows/fs/is_file_read_write_impl.rs
wasmtime-15.0.0 ./ext/cargo-vendor/cap-primitives-2.0.1/src/windows/fs/is_file_read_write_impl.rs
wasmtime-14.0.4 ./ext/cargo-vendor/cap-primitives-2.0.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-14.0.3 ./ext/cargo-vendor/cap-primitives-2.0.0/src/windows/fs/is_file_read_write_impl.rs
wasmtime-14.0.1 ./ext/cargo-vendor/cap-primitives-2.0.0/src/windows/fs/is_file_read_write_impl.rs