10 releases

0.5.2 Jan 30, 2023
0.5.0 Jun 12, 2021
0.4.1 Sep 30, 2019
0.4.0 May 2, 2019
0.3.2 Nov 15, 2018

#20 in Operating systems

Download history 47495/week @ 2022-12-02 47500/week @ 2022-12-09 48316/week @ 2022-12-16 34995/week @ 2022-12-23 35483/week @ 2022-12-30 48285/week @ 2023-01-06 49380/week @ 2023-01-13 51344/week @ 2023-01-20 56844/week @ 2023-01-27 55289/week @ 2023-02-03 57218/week @ 2023-02-10 57838/week @ 2023-02-17 57425/week @ 2023-02-24 56109/week @ 2023-03-03 65676/week @ 2023-03-10 50659/week @ 2023-03-17

238,134 downloads per month
Used in 264 crates (49 directly)

MIT/Apache

17KB
344 lines

Opener

This crate provides the ability to open a file or link with the default program configured on the system.

See the docs for more details:

Docs

License

Licensed under either of

at your option.

Third party software

See LICENSE-THIRD-PARTY

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


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(())
# }

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.

Dependencies

~150KB