Crate opener

Source
Expand description

This crate provides the open function, which opens a file or link with the default program configured on the system:

// open a website
opener::open("https://www.rust-lang.org")?;

// open a file
opener::open("../Cargo.toml")?;

An open_browser function is also provided, for when you intend on opening a file or link in a browser, specifically. This function works like the open function, but explicitly allows overriding the browser launched by setting the $BROWSER environment variable.

§Crate features

  • reveal - Enables usage of the reveal function.

Enums§

OpenError
An error type representing the failure to open a path. Possibly returned by the open function.

Functions§

open
Opens a file or link with the system default program.
open_browser
Opens a file or link with the system default program, using the BROWSER environment variable when set.
revealreveal
Opens the default file explorer and reveals a file or folder in its containing folder.