#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

#5 in Web programming

Download history 4942/week @ 2018-10-11 7074/week @ 2018-10-18 6067/week @ 2018-10-25 7513/week @ 2018-11-01 7304/week @ 2018-11-08 7453/week @ 2018-11-15 8488/week @ 2018-11-22 7974/week @ 2018-11-29 9133/week @ 2018-12-06 9916/week @ 2018-12-13 9402/week @ 2018-12-20 7729/week @ 2018-12-27 6911/week @ 2019-01-03

34,031 downloads per month
Used in 26 crates (4 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
~24K SLoC