This doesn't fulfil the "without user interaction" bit, though, does it? The problem with those "let the user pick a file and the program just gets an opaque file handle"-style solutions is that they break down for any kind of file format that implicitly or explicitly consists of more than one single, atomic file that can stand for itself and doesn't require accessing data stored in other files.
E.g. playlists (letting the user pick the playlist through the OS-blessed file dialogue isn't enough, as you also need to access all media files referenced by that playlist), any kind of multi-part files (multi-part MKVs, multi-part RAR archives, whatever...), subtitles (the current expectation is that if you open a video, the video player is able to automatically find matching subtitle files stored in the same directory), locally stored HTML documents (your browser might need to load additional CSS/JS/images/... and you might also want to follow any links without having to go through a file picker each time...)
> That's what xdg portals are for: display a native file picker, pass the file descriptor. https://docs.flatpak.org/en/latest/desktop-integration.html?...
This doesn't fulfil the "without user interaction" bit, though, does it? The problem with those "let the user pick a file and the program just gets an opaque file handle"-style solutions is that they break down for any kind of file format that implicitly or explicitly consists of more than one single, atomic file that can stand for itself and doesn't require accessing data stored in other files.
E.g. playlists (letting the user pick the playlist through the OS-blessed file dialogue isn't enough, as you also need to access all media files referenced by that playlist), any kind of multi-part files (multi-part MKVs, multi-part RAR archives, whatever...), subtitles (the current expectation is that if you open a video, the video player is able to automatically find matching subtitle files stored in the same directory), locally stored HTML documents (your browser might need to load additional CSS/JS/images/... and you might also want to follow any links without having to go through a file picker each time...)