1
0
mirror of https://github.com/jht5945/finding.git synced 2025-12-27 13:20:03 +08:00

len_of_large_file

This commit is contained in:
2020-04-30 01:11:09 +08:00
parent cb6f3cd4bd
commit 68d51461bd

View File

@@ -14,7 +14,7 @@ pub fn read_file_content<P: AsRef<Path>>(p: P, len_of_large_file: u64) -> XResul
return Err(new_box_error(&format!("File is not a file: {:?}", file)));
}
let file_len = file.metadata()?.len();
if file_len > len_of_large_file {
if file_len >= len_of_large_file {
return Err(new_box_error(&format!("File too large: {:?}, len: {}", file, file_len)));
}
let mut f = File::open(file)?;