Skip to main content

read_file_segment_to_string

Function read_file_segment_to_string 

Source
pub fn read_file_segment_to_string(
    path: &Path,
    offset: u64,
    length: u64,
    max_file_size: u64,
) -> Result<String>
Expand description

Read a text file segment as a string

§Arguments

  • path - Path to the file to read
  • offset - Starting offset in bytes
  • length - Length of segment to read in bytes
  • max_file_size - Maximum allowed file size

§Returns

A string containing the file segment contents

§Errors

Returns an error if the file segment cannot be read