What is an operating system independent way to open a file with associated program from C++? Is there a solution in Boost, or something like it?
More specifically, something that would cover Windows, Mac OS X, and Linux.
What I am trying to do is open a file ending in the .txt extension in the program that the user already has set up to open it if they were to open it themselves via clicking it or command line.
The mechanism needs to be asynchronous.
QDesktopServices::openUrl from Qt library provides this. It is asynchronous (non-blocking).
Just calling the name of the data file with system() should work on any OS that supports typing the filename on the command line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With