mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
csplit: defer IO read error handling to iterator.
This commit is contained in:
parent
1dc463fd26
commit
757c0b260e
1 changed files with 0 additions and 6 deletions
|
@ -582,12 +582,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
} else {
|
} else {
|
||||||
let file = File::open(file_name)
|
let file = File::open(file_name)
|
||||||
.map_err_context(|| format!("cannot access {}", file_name.quote()))?;
|
.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))?)
|
Ok(csplit(&options, &patterns, BufReader::new(file))?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue