pub fn read_to_file<R, P>(source: &mut R, target: P) -> Result<File, FileError>where R: Read, P: AsRef<Path>,
Reads all of the data from source and writes it into a new file at target.