#open #default #launcher #browser

opener

Open a file or link using the system default program

5 unstable releases

0.3.2 Nov 15, 2018
0.3.1 Nov 15, 2018
0.3.0 Aug 18, 2018
0.2.0 Aug 8, 2018
0.1.0 Aug 8, 2018

#1 in Simulation

Download history 8340/week @ 2018-11-17 8156/week @ 2018-11-24 9422/week @ 2018-12-01 9810/week @ 2018-12-08 9248/week @ 2018-12-15 7613/week @ 2018-12-22 8151/week @ 2018-12-29 8273/week @ 2019-01-05 8880/week @ 2019-01-12 8741/week @ 2019-01-19 8498/week @ 2019-01-26 10207/week @ 2019-02-02 10794/week @ 2019-02-09 8321/week @ 2019-02-16 9820/week @ 2019-02-23

34,031 downloads per month
Used in 35 crates (5 directly)

MIT/Apache

15KB
151 lines


lib.rs:

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

# fn main() -> Result<(), ::opener::OpenError> {
// open a website
opener::open("https://www.rust-lang.org")?;

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

Platform Implementation Details

On Windows the ShellExecuteW Windows API function is used. On Mac the system open command is used. On other platforms, the xdg-open script is used. The system xdg-open is not used; instead a version is embedded within this library.

Dependencies

~1.5MB
~23K SLoC