INNER CODE UNIT · Rust
MAX_INPUT_BYTES
edwardkim/rhwp · bindings/Native/src/lib.rs:132
const MAX_INPUT_BYTES: u64 = 128 * 1024 * 1024;
const MAX_SELECTED_PAGES: u32 = 256;
// Reject ordinary non-file paths before open (a FIFO could otherwise block).
// Recheck the opened handle below; this does not promise race-free path lookup.
let path_metadata = fs::metadata(input_path).map_err(|e| {
format!(
"PDF input metadata failed - {}: {}",
input_path.display(),
e
)
})?;
if !path_metadata.is_file() {
return Err("PDF input must be a regular file.".to_string());
}
let input = fs::File::open(input_path)
.map_err(|e| format!("PDF input read failed - {}: {}", input_path.display(), e))?;
let metadata = input