fn write_output( output: Vec<u8>, directory_path: &PathBuf, file_name: &str, ) -> Result<(), Error>
Helper closure to write output to file