Hi All, please help me find crate having this method already implemented. Linux method link - https://linux.die.net/man/3/open_excl
It seems like it’s not a standard posix function. Based on this stack overflow article it seems like it is just using
O_EXCL and with mode
0600. This can be replicated using the standard library with
use std::os::unix::fs::OpenOptionsExt; let f = std::fs::OpenOptions::new().create_new(true).mode(0o600).open(path_to_file)?;
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.