I am writing a C program that needs to open a location in the default file explorer (e.g. open C:\Program Files (x86)\somefolder
in the Windows file explorer, or open /usr/share/somefolder
in Nautilus/Nemo/whatever default file explorer program is set).
Is there an universal way to do that, as in a way that uses the same code for both Windows and Linux?
I did find this question that uses ShellExecute()
, but this probably doesn't work on Linux.
So, is it possible, and if not, is there a way to separate the code for Linux and Windows?