stat

Function stat 

Source
pub unsafe fn stat<P: AsRef<Path>>(
    filename: P,
    statbuf: &mut stat_t,
) -> Result<(), Errno>
Expand description

Get file status about a file.

ยงExamples

let path = "/etc/passwd";
let mut stat = nc::stat_t::default();
let ret = unsafe { nc::stat(path, &mut stat) };
assert!(ret.is_ok());
// Check fd is a regular file.
assert!(nc::S_ISREG(stat.st_mode as nc::mode_t));