pub fn load_or_create_config_file() -> Result<File, Error> {
        //FIXME Not compatible with windows
        let dir = match dirs::home_dir() {
            Some(dir) => Path::new(&dir.to_str().unwrap().to_string()).join(".config/rmemo/"),
            None => panic!("faild fetch home_dir name"),
        };

        DirBuilder::new().recursive(true).create(dir.clone())?;

        let filepath = &dir.join("config.toml");

        let file = OpenOptions::new()
            .create(true)
            .write(true)
            .append(true)
            .read(true)
            .open(filepath)?;

        Ok(file)
    }
///Get the file pointer of the setting file.
///When there is no file, a setting file is created.
Get the file pointer of the setting file.
When there is no file, a setting file is created.
Get the file pointer of the setting file . When there is no file a setting file is created .
pub fn load_or_create_config_file() -> Result<File, Error> {
        //FIXME Not compatible with windows
        let dir = match dirs::home_dir() {
            Some(dir) => Path::new(&dir.to_str().unwrap().to_string()).join(".config/rmemo/"),
            None => panic!("faild fetch home_dir name"),
        };
        DirBuilder::new().recursive(true).create(dir.clone())?;
        let filepath = &dir.join("config.toml");
        let file = OpenOptions::new()
            .create(true)
            .write(true)
            .append(true)
            .read(true)
            .open(filepath)?;
        Ok(file)
    }
pub fn load_or_create_config_file ( ) -> Result < File , Error > { //FIXME Not compatible with windows let dir = match dirs :: home_dir ( ) { Some ( dir ) => Path :: new ( & dir . to_str ( ) . unwrap ( ) . to_string ( ) ) . join ( " " ) , None => panic ! ( " " ) , } ; DirBuilder :: new ( ) . recursive ( true ) . create ( dir . clone ( ) ) ? ; let filepath = & dir . join ( " " ) ; let file = OpenOptions :: new ( ) . create ( true ) . write ( true ) . append ( true ) . read ( true ) . open ( filepath ) ? ; Ok ( file ) }
Get the file pointer of the setting file.
Get the file pointer of the setting file .