Skip to main content

file_set_contents_full

Function file_set_contents_full 

Source
pub fn file_set_contents_full(
    filename: impl AsRef<Path>,
    contents: &[u8],
    flags: FileSetContentsFlags,
    mode: i32,
) -> Result<(), Error>
Available on crate feature v2_66 only.
Expand description

t exist before and is created, it will be given the permissions from @mode. Otherwise, the permissions of the existing file will remain unchanged.

§filename

name of a file to write @contents to, in the GLib file name encoding

§contents

string to write to the file

§flags

flags controlling the safety vs speed of the operation

§mode

file mode, as passed to open(); typically this will be 0666

§Returns

true on success, false if an error occurred