pub fn open_file(filename: &str) -> Result<BufWriter<fs::File>> {
    log::trace!("enter: open_file({})", filename);

    let file = fs::OpenOptions::new() // std fs
        .create(true)
        .append(true)
        .open(filename)
        .with_context(|| fmt_err(&format!("Could not open {}", filename)))?;

    let writer = BufWriter::new(file); // std io

    log::trace!("exit: open_file -> {:?}", writer);
    Ok(writer)
}
/// Given the path to a file, open the file in append mode (create it if it doesn't exist) and
/// return a reference to the buffered file
Given the path to a file, open the file in append mode (create it if it doesn't exist) and
return a reference to the buffered file
Given the path to a file open the file in append mode ( create it if it doesn ' t exist ) and return a reference to the buffered file
pub fn open_file(filename: &str) -> Result<BufWriter<fs::File>> {
    log::trace!("enter: open_file({})", filename);
    let file = fs::OpenOptions::new() // std fs
        .create(true)
        .append(true)
        .open(filename)
        .with_context(|| fmt_err(&format!("Could not open {}", filename)))?;
    let writer = BufWriter::new(file); // std io
    log::trace!("exit: open_file -> {:?}", writer);
    Ok(writer)
}
pub fn open_file ( filename : & str ) -> Result < BufWriter < fs :: File > > { log :: trace ! ( " " filename ) ; let file = fs :: OpenOptions :: new ( ) // std fs . create ( true ) . append ( true ) . open ( filename ) . with_context ( | | fmt_err ( & format ! ( " " filename ) ) ) ? ; let writer = BufWriter :: new ( file ) ; // std io log :: trace ! ( " " writer ) ; Ok ( writer ) }
Given the path to a file, open the file in append mode (create it if it doesn't exist) and
return a reference to the buffered file
Given the path to a file open the file in append mode ( create it if it doesn ' t exist ) and return a reference to the buffered file
filename
&str