#open-file #file #open #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

#4 in #invocation

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