Function nc::open[][src]

pub fn open<P: AsRef<Path>>(
    filename: P,
    flags: i32,
    mode: mode_t
) -> Result<i32, Errno>
Expand description

Open and possibly create a file.

let path = "/etc/passwd";
let ret = nc::open(path, nc::O_RDONLY, 0);
assert!(ret.is_ok());
let fd = ret.unwrap();
assert!(nc::close(fd).is_ok());