pub fn read_file_segment(
path: &Path,
offset: u64,
length: u64,
max_file_size: u64,
) -> Result<Vec<u8>>Expand description
Read a specific segment of a file
This function reads a specific segment of a file using memory mapping or direct I/O, depending on the segment size.
§Arguments
path- Path to the fileoffset- Starting offset in byteslength- Length of segment to read in bytesmax_file_size- Maximum allowed file size
§Returns
A vector containing the file segment contents
§Errors
Returns an error if the file cannot be read or exceeds the size limit