From acee8af45d71e06babf1e8f65cb25f2076a935a2 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Thu, 14 Dec 2017 00:31:03 -0800 Subject: add buffered read to path import --- src/drive.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drive.rs b/src/drive.rs index 01807a2..39b4025 100644 --- a/src/drive.rs +++ b/src/drive.rs @@ -1,5 +1,5 @@ -use std::io::{Read, Write}; +use std::io::{Read, Write, BufReader}; use std::path::{Path, PathBuf}; use std::os::unix::fs::{MetadataExt, OpenOptionsExt}; use std::fs::{File, OpenOptions, read_dir, create_dir_all}; @@ -443,6 +443,7 @@ impl<'a> DatDrive { info!("importing file: '{:?}' as '{:?}'", source.as_ref(), dest.as_ref()); let in_file = File::open(source)?; let in_metadata = in_file.metadata()?; + let in_file = BufReader::new(in_file); let mut stat = Stat::new(); stat.set_mode(in_metadata.mode()); stat.set_uid(in_metadata.uid()); -- cgit v1.2.3