[][src]Function scrawl::open

pub fn open(p: &Path) -> Result<String, ScrawlError>

Open opens a text buffer in an editor with the contents of the file specified. This does not edit the contents of the file. Returns a Result with the contents of the buffer.

Example

use std::path::Path;
 
fn main() {
    let path = Path::new("hello.txt");
    let output = match scrawl::open(path) {
         Ok(s) => s,
         Err(e) => e.to_string()
   };
   println!("{}", output);
}