Skip to main content

tail_file

Function tail_file 

Source
pub fn tail_file(path: &Path, max_bytes: u64) -> String
Expand description

Read the last max_bytes of any file on disk, returning UTF-8 text. If the file is smaller than max_bytes the whole file is returned. Partial UTF-8 at the truncation boundary is handled by skipping to the first newline. Returns an empty string on any I/O error.