@@ -519,46 +519,13 @@ impl OpenOptions {
519519 ///
520520 /// let file = OpenOptions::new().write(true).create_new(true).open("foo.txt");
521521 /// ```
522- #[ stable( feature = "expand_open_options" , since = "1.7.0" ) ]
522+ #[ unstable( feature = "expand_open_options" ,
523+ reason = "recently added" ,
524+ issue = "30014" ) ]
523525 pub fn create_new ( & mut self , create_new : bool ) -> & mut OpenOptions {
524526 self . 0 . create_new ( create_new) ; self
525527 }
526528
527- /// Pass custom open flags to the operating system.
528- ///
529- /// Windows and the various flavours of Unix support flags that are not
530- /// cross-platform, but that can be useful in some circumstances. On Unix they will
531- /// be passed as the variable _flags_ to `open`, on Windows as the
532- /// _dwFlagsAndAttributes_ parameter.
533- ///
534- /// The cross-platform options of Rust can do magic: they can set any flag necessary
535- /// to ensure it works as expected. For example, `.append(true)` on Unix not only
536- /// sets the flag `O_APPEND`, but also automatically `O_WRONLY` or `O_RDWR`. This
537- /// special treatment is not available for the custom flags.
538- ///
539- /// Custom flags can only set flags, not remove flags set by Rusts options.
540- ///
541- /// For the custom flags on Unix, the bits that define the access mode are masked
542- /// out with `O_ACCMODE`, to ensure they do not interfere with the access mode set
543- /// by Rusts options.
544- ///
545- /// # Examples
546- ///
547- /// ```rust,ignore
548- /// extern crate libc;
549- /// extern crate winapi;
550- /// use std::fs::OpenOptions;
551- ///
552- /// let options = OpenOptions::new().write(true);
553- /// if cfg!(unix) { options.custom_flags(libc::O_NOFOLLOW); }
554- /// if cfg!(windows) { options.custom_flags(winapi::FILE_FLAG_BACKUP_SEMANTICS); }
555- /// let file = options.open("foo.txt");
556- /// ```
557- #[ stable( feature = "expand_open_options" , since = "1.7.0" ) ]
558- pub fn custom_flags ( & mut self , flags : u32 ) -> & mut OpenOptions {
559- self . 0 . custom_flags ( flags) ; self
560- }
561-
562529 /// Opens a file at `path` with the options specified by `self`.
563530 ///
564531 /// # Errors
0 commit comments