file_get

Function file_get 

Source
pub fn file_get<P: AsRef<Path>>(
    path: P,
    base_path: Option<&str>,
) -> Result<String>
Expand description

Read the contents of a file as a string

§Arguments

  • path - Path to the file to read
  • base_path - Optional base path for security checking

§Returns

  • Ok(String) - The file contents
  • Err(io::Error) - If the file can’t be read