Skip to main content

head_file_direct

Function head_file_direct 

Source
pub fn head_file_direct(filename: &str, n: u64, delimiter: u8) -> Result<bool>
Expand description

Ultra-fast direct path: single file, positive line count, writes directly to stdout fd without BufWriter overhead. Uses raw write(2) on Linux; on other platforms uses a small stack-buffered stdout. Returns Ok(true) on success, Ok(false) on file error (already printed).