Struct rsfs::disk::OpenOptions [] [src]

pub struct OpenOptions(_);

Options and flags which can be used to configure how a file is opened.

This builder, created from GenFSs new_openopts, exposes the ability to configure how a [File] is opened and what operations are permitted on the open file. GenFSs open_file and create_file methods are aliases for commonly used options with this builder.

This builder is a single element tuple containing a std::fs::OpenOptions that implements rsfs::OpenOptions and supports unix extensions.

Examples

Opening a file to read:

let f = fs.new_openopts()
          .read(true)
          .open("f")?;

Opening a file for both reading and writing, as well as creating it if it doesn't exist:

let mut f = fs.new_openopts()
              .read(true)
              .write(true)
              .create(true)
              .open("f")?;

Trait Implementations

impl Clone for OpenOptions
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for OpenOptions
[src]

Formats the value using the given formatter.

impl OpenOptions for OpenOptions
[src]

The File type in the module implementing this trait.

Sets the option for read access. Read more

Sets the option for write access. Read more

Sets the option for append mode. Read more

Sets the option for truncating an existing file. Read more

Sets the option to create the file if it does not exist. Read more

Sets the option to always create a new file. Read more

Opens a file at path with options specified by self. Read more

impl OpenOptionsExt for OpenOptions
[src]

Sets the mode bits that a new file will be opened with. Read more

Pass custom flags to the flags argument of open. Read more