We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe8ab8a commit 27c90b8Copy full SHA for 27c90b8
library/std/src/sys/unix/fs.rs
@@ -692,6 +692,7 @@ impl OpenOptions {
692
}
693
694
695
+
696
impl File {
697
pub fn open(path: &Path, opts: &OpenOptions) -> io::Result<File> {
698
let path = cstr(path)?;
@@ -962,6 +963,12 @@ pub fn rename(old: &Path, new: &Path) -> io::Result<()> {
962
963
Ok(())
964
965
966
+pub fn get_openopetions_as_cint(from: OpenOptions) -> io::Result<libc::c_int> {
967
+ let access_mode = from.get_access_mode()?;
968
+ let creation_mode = from.get_creation_mode()?;
969
+ Ok(creation_mode | access_mode)
970
+}
971
972
pub fn set_perm(p: &Path, perm: FilePermissions) -> io::Result<()> {
973
let p = cstr(p)?;
974
cvt_r(|| unsafe { libc::chmod(p.as_ptr(), perm.mode) })?;
0 commit comments