Skip to main content

read_capped

Function read_capped 

Source
pub fn read_capped(file: File, max_bytes: usize) -> Result<(Vec<u8>, bool)>
Expand description

Like read_file_capped, but reads from an already-open std::fs::File.

Used when the caller has obtained the handle through a confinement-checked open (e.g. mermaid_runtime::open_beneath) and must read the same inode the check resolved — feeding a path back to read_file_capped would reopen by name and reintroduce the symlink TOCTOU (#77).