#open-file #open #file #interface #multi-platform #invocation #file-manager

open_with

Provides a multiplatform invocation interface to the native open-with interface for files

3 releases

0.1.2 Jul 18, 2023
0.1.1 Jul 16, 2023
0.1.0 Jul 6, 2023

#3 in #invocation

Download history 19/week @ 2024-02-16 36/week @ 2024-02-23 12/week @ 2024-03-01 4/week @ 2024-03-08 2/week @ 2024-03-15 42/week @ 2024-03-29 12/week @ 2024-04-05

54 downloads per month

Apache-2.0

22KB
482 lines

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);

Dependencies

~0–1.2MB
~23K SLoC