pub fn reveal<P>(path: P) -> Result<(), OpenError>
Available on crate feature
reveal
only.Expand description
Opens the default file explorer and reveals a file or folder in its containing folder.
§Errors
This function may or may not return an error if the path does not exist.
§Platform Implementation Details
- On Windows and Windows Subsystem for Linux (WSL) the
explorer.exe /select, <path>
command is used. - On Mac the system
open -R
command is used. - On non-WSL Linux the
file-manager-interface
or theorg.freedesktop.portal.OpenURI
DBus Interface is used if available, falling back to opening the containing folder withopen
. - On other platforms, the containing folder is shown with
open
.