split: read ahead input

This commit is contained in:
oech3
2026-06-06 16:12:57 +02:00
committed by Daniel Hofstetter
parent 0024b1a963
commit 78cc6399c9
4 changed files with 5 additions and 0 deletions
Generated
+1
View File
@@ -4138,6 +4138,7 @@ dependencies = [
"codspeed-divan-compat",
"fluent",
"memchr",
"rustix",
"tempfile",
"thiserror 2.0.18",
"uucore",
+1
View File
@@ -2066,6 +2066,7 @@ dependencies = [
"clap",
"fluent",
"memchr",
"rustix",
"thiserror",
"uucore",
]
+1
View File
@@ -21,6 +21,7 @@ doctest = false
[dependencies]
clap = { workspace = true }
memchr = { workspace = true }
rustix = { workspace = true }
uucore = { workspace = true, features = ["fs", "parser-size"] }
thiserror = { workspace = true }
fluent = { workspace = true }
+2
View File
@@ -1539,6 +1539,8 @@ fn split(settings: &Settings) -> UResult<()> {
let r = File::open(Path::new(&settings.input)).map_err_context(
|| translate!("split-error-cannot-open-for-reading", "file" => settings.input.quote()),
)?;
#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd"))]
let _ = rustix::fs::fadvise(&r, 0, None, rustix::fs::Advice::Sequential);
Box::new(r) as Box<dyn Read>
};
let mut reader = if let Some(c) = settings.io_blksize {