mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
csplit: defer IO read error handling to iterator.
This commit is contained in:
committed by
Daniel Hofstetter
parent
1dc463fd26
commit
757c0b260e
@@ -582,12 +582,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
} else {
|
||||
let file = File::open(file_name)
|
||||
.map_err_context(|| format!("cannot access {}", file_name.quote()))?;
|
||||
let file_metadata = file
|
||||
.metadata()
|
||||
.map_err_context(|| format!("cannot access {}", file_name.quote()))?;
|
||||
if !file_metadata.is_file() {
|
||||
return Err(CsplitError::NotRegularFile(file_name.to_string()).into());
|
||||
}
|
||||
Ok(csplit(&options, &patterns, BufReader::new(file))?)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user