[][src]Function scrawl::open

pub fn open<P: AsRef<Path>>(path: P) -> 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


    let output = scrawl::open("hello.txt")?;
    println!("{}", output);

    let path = Path::new("website.html");
    let output = scrawl::open(path)?;
    println!("{}", output);