I've also seen mentioned "sensible-browser" script for debian-derivatives, havent checked if its part of standard raspbian.xdg-open is a desktop-independent tool for configuring the default applications of a user. Many applications invoke the xdg-open command internally.
So a full-scale system call is actually the 'right' way to do it? Ouch. I did spot the assorted 'exec()' functions but they all claim to replace the current process; not quite what I'm after.topguy wrote:"xdg-open" is probably the only way that would be portable between different linux-desktops.
xdg-open is a desktop-independent tool for configuring the default applications of a user. Many applications invoke the xdg-open command internally.
You haven't really explained your requirements good enough for us to pick a "right" way.timrowledge wrote: So a full-scale system call is actually the 'right' way to do it? Ouch. I did spot the assorted 'exec()' functions but they all claim to replace the current process; not quite what I'm after.
OK, I'll be more precise, as well as I can anyway.topguy wrote:You haven't really explained your requirements good enough for us to pick a "right" way.
system() is probablly not the right call for the job since it will wait until whatever process it runs exits which is probablly not what you want.timrowledge wrote:OK, I'll be more precise, as well as I can anyway.topguy wrote:You haven't really explained your requirements good enough for us to pick a "right" way.
Scratch needs to launch a web-browser to access online help. In RISC OS I'd just use the uri_dispatch call and it would just happen. In unix I'd naively use system() but I've been scolded in past times for doing so on the grounds of... something or other about too heavy-weight, dangerous, likely to cause spots or bad breath or something. If it really is the right way to do this, then I'll just do it.
Why not call it as a background process? Then it won't wait.system() is probablly not the right call for the job since it will wait until whatever process it runs exits which is probablly not what you want.