//open file with read and write permissions

open file with read and write permissions
open file with read and write permissions
pub fn open_file(path: &str, rw: bool) -> Result<File, io::Error> {
    OpenOptions::new()
        .read(true)
        .write(rw)
        .create(rw)
        .open(path.to_string())
}
pub fn open_file ( path : & str , rw : bool ) -> Result < File , io :: Error > { OpenOptions :: new ( ) . read ( true ) . write ( rw ) . create ( rw ) . open ( path . to_string ( ) ) }
open file with read and write permissions
open file with read and write permissions
path
&str
rw
bool