Skip to main content

read_to_string

Function read_to_string 

Source
pub fn read_to_string(path: &str) -> Result<String, CoreError>
Expand description

Read a file into a string.

This stays as a small convenience helper for low-level modules that treat blocking filesystem or procfs reads as an acceptable boundary cost. Read the entire contents of a file into a string.

ยงErrors

  • EACCES: Permission denied.
  • ENOENT: The path does not exist.
  • EIO: Low-level I/O error.