open_with

Crates.ioopen_with
lib.rsopen_with
version0.1.2
sourcesrc
created_at2023-07-06 16:54:22.628363
updated_at2023-07-18 15:14:29.701419
descriptionProvides a multiplatform invocation interface to the native open-with interface for files.
homepagehttps://github.com/longmathemagician/open_with
repositoryhttps://github.com/longmathemagician/open_with
max_upload_size
id910095
size33,294
(longmathemagician)

documentation

https://docs.rs/open_with/latest/

README

A simple library for open-with dialog invocation

This library provides a simple multiplatform interface for opening a file with the system default application, invoking the platform's open-with dialog to open a file with one of several programs, revealing the file in the default file manager, or showing the file's properties through the default handler.

Supports Windows through shell-execute, Linux/systemd through xdg-desktop-portal, and macOS through finder automation.

The macOS implementation requires escalated privileges on recent OS versions and is occasionally unreliable for reasons I've been unable to ascertain. If anyone has a better solution for this platform a PR would be greatly appreciated.

Example

let file_path = PathBuf::from("src/lib.rs");
let _result = open_with(file_path);
Commit count: 9

cargo fmt