#open #default #launcher #browser

opener

Open a file or link using the system default program

6 releases (3 breaking)

0.4.0 May 2, 2019
0.3.2 Nov 15, 2018
0.3.0 Aug 18, 2018
0.2.0 Aug 8, 2018
0.1.0 Aug 8, 2018

#4 in #browser

Download history 8790/week @ 2019-01-17 8743/week @ 2019-01-24 9514/week @ 2019-01-31 10897/week @ 2019-02-07 8791/week @ 2019-02-14 9288/week @ 2019-02-21 8432/week @ 2019-02-28 8865/week @ 2019-03-07 8137/week @ 2019-03-14 8015/week @ 2019-03-21 8837/week @ 2019-03-28 9643/week @ 2019-04-04 9933/week @ 2019-04-11 8123/week @ 2019-04-18 8887/week @ 2019-04-25

38,794 downloads per month
Used in 37 crates (5 directly)

MIT/Apache

11KB
156 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

~536KB