Comment 138 for bug 1142213

Revision history for this message
In , Hugo Pereira Da Costa (hugo-pereira) wrote :

@Ruslan
problem with popen:
- it is defined on windows (with mingw at least) and works, but opens a terminal to execute a command. (not so nice). And I'm not sure _popen would fix this, would it ?

- on unix, it does not allow to easily redirect stderr, so you get an error message (for every application) when kde4-config is not installed. So that I had to add a 2> /dev/null (committed), to hide the (armless) error message, in current master, because users were already complaining.
But this, in turn, is not portable to windows.

All this is nicely handled in g_spawn, when it works ...

popen being more likely to work on windows depends on MinGW (not even sure if it is implemented with VC ...). While g_spawn depends on glib. Which one is more error prone I do not know (I would assume glib, but ...)

So bottomline: if we want to stick to popen (to be more glib-error safe), we'd likely need more code (and more #ifdef) than what we have now ...