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 52c50ba commit 8d3f20fCopy full SHA for 8d3f20f
src/libstd/sys/unix/ext/fs.rs
@@ -63,6 +63,18 @@ pub trait OpenOptionsExt {
63
/// If no `mode` is set, the default of `0o666` will be used.
64
/// The operating system masks out bits with the systems `umask`, to produce
65
/// the final permissions.
66
+ ///
67
+ /// # Examples
68
69
+ /// ```rust,ignore
70
+ /// extern crate libc;
71
+ /// use std::fs::OpenOptions;
72
+ /// use std::os::unix::fs::OpenOptionsExt;
73
74
+ /// let mut options = OpenOptions::new();
75
+ /// options.mode(0o644); // Give read/write for owner and read for others.
76
+ /// let file = options.open("foo.txt");
77
+ /// ```
78
#[stable(feature = "fs_ext", since = "1.1.0")]
79
fn mode(&mut self, mode: u32) -> &mut Self;
80
0 commit comments