devela::_dep::rustix::fs

Function is_file_read_write

pub fn is_file_read_write<Fd>(fd: Fd) -> Result<(bool, bool), Errno> 
where Fd: AsFd,
Available on crate feature dep_rustix only.
Expand description

fcntl(fd, F_GETFL) & O_ACCMODE

Returns a pair of booleans indicating whether the file descriptor is readable and/or writable, respectively. This is only reliable on files; for example, it doesn’t reflect whether sockets have been shut down; for general I/O handle support, use io::is_read_write.