Skip to main content

Module cat

Module cat 

Source

Structs§

CatConfig
Configuration for cat

Enums§

CatPlainError
Errors specific to the plain-file fast path on Linux. Separates directory/same-file detection from I/O errors so callers can emit GNU-compatible diagnostics without redundant syscalls.

Functions§

cat_file
Process a single file for cat
cat_plain_file
Plain cat for a single file — tries zero-copy, then falls back to read/write loop. Note: On Linux, callers that need directory/same-file detection should call cat_plain_file_linux directly to avoid redundant syscalls.
cat_plain_file_linux
Zero-copy file→stdout on Linux using splice, copy_file_range, or fast read/write. Also performs directory check and input==output detection using the fstat results to avoid redundant syscalls in the caller.
cat_plain_stdin
Plain cat for stdin — try splice on Linux, otherwise bulk read+write
cat_with_options
Cat with options (numbering, show-ends, show-tabs, show-nonprinting, squeeze)