Skip to main content

read_plain_file

Function read_plain_file 

Source
pub fn read_plain_file(path: &Path, limit: u64) -> Result<Vec<u8>>
Expand description

What: The bytes of the plain file at path, opened without blocking and without following a link, refused when it is anything else or larger than limit. Why: Opening a named pipe for reading waits for a writer, and a command that waits while it owns the conversion blocks every other command that wants it; the type is read from the open handle, and the read is bounded.

In TS you’d write (pseudocode):

function readPlainFile(path: string, limit: number): Buffer; // throws