[Portland] Proposal: Rework the current xdg-utils. (with implementation details)

Zhe Su james.su at gmail.com
Mon Nov 10 23:58:49 PST 2008


Having standard dbus interface doesn't mean that those shell scripts must be
removed. If we have the standard dbus interface, we can modify those scripts
to use it directly when it's avaiable, and fallback to current solution if
the dbus service is not available. End users and existing applications won't
be affected. But newly developed applications can take advantage of the new
dbus service.

Regards
James Su

On Tue, Nov 11, 2008 at 3:36 PM, Peter Åstrand <astrand at cendio.se> wrote:

> On Tue, 11 Nov 2008, Zhe Su wrote:
>
> > As an application developer, calling a shell script inside an
> >application to do something is really bad. For example, my application
> >needs open url or local file by external applications, currently there is
> >only way to do it: execute xdg-open shell script by using system() or
> >exec() system call. But this approach has many limitations, such as, it's
> >impossible to know if and when the application is started successfully.
>
> I disagree. Calling an external program is an easy and universal solution.
> The return value from xdg-open indicates errors. From the man page:
>
> "An exit code of 0 indicates success ..."

xdg-open's exit code is not reliable. The open operation is actually async,
returning 0 doesn't mean the operation has finished successfully, it only
means the corresponding open command exits without error. And with xdg-open
there is no way for the application to know when the external application is
successfully started up.
And it's not guaranteed that xdg-open will run in async mode. It might be
blocked when calling the real open command until the external application is
launched successfully. We encountered such issue in one of our application.


>
> The whole point of xdg-utils is that it should cover different
> desktop environments. We should support current and future non-DBUS
> environments, so xdg-utils itself shouldn't depend on DBUS.
>
> Regards,
> ---
> Peter Åstrand           ThinLinc Chief Developer
> Cendio AB               http://www.cendio.com
> Wallenbergs gata 4
> 583 30 Linköping        Phone: +46-13-21 46 00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/portland/attachments/20081111/8f1fd1df/attachment.htm 


More information about the Portland mailing list