Fwd: Fwd: GIO and launching applications with a working directory



For anyone interested, here's an answer from Mr. Gio.

---------- Forwarded message ----------
From: Alexander Larsson <alexl redhat com>
Date: Fri, Oct 10, 2008 at 11:03 AM
Subject: Re: Fwd: GIO and launching applications with a working directory
To: Axel von Bertoldi <bertoldia gmail com>


On Fri, 2008-10-10 at 08:37 -0600, Axel von Bertoldi wrote:
>
>
> On Fri, Oct 10, 2008 at 8:29 AM, Axel von Bertoldi
> <bertoldia gmail com> wrote:
>
>
>
>         On Fri, Oct 10, 2008 at 1:42 AM, Alexander Larsson
>         <alexl redhat com> wrote:
>                 On Thu, 2008-10-09 at 17:16 -0600, Axel von Bertoldi
>                 wrote:
>
>                 >
>                 > I'm in the process of migrating from glib's
>                 g_spawn_async to Gio's
>                 > g_app_info_launch and/or
>                 g_app_info_launch_default_for_uri. I was
>                 > frequently using the working_directory argument of
>                 g_spawn_async to
>                 > specify the app's working directory, but I can't
>                 find how to do this
>                 > in Gio.
>                 >
>                 > Is it possible to launch an application using Gio
>                 and specify that
>                 > applications working directory? If no, why not!
>
>
>                 There is no API for doing this. The GAppInfoLaunch api
>                 is very generic
>                 since it needs to support many ways of launching
>                 applications, not just
>                 the traditional fork/exec. For instance, on win32 it
>                 might happen via
>                 OLE communications, and we've talked about future
>                 plans to launch via
>                 dbus. This means its not really possible to control
>                 lowlevel aspects
>                 like env vars and starting directory as they not
>                 always in our control.
>
> Sorry to bother again. Couldn't this information (wd and env) be
> include in the GAppLaunchContext object passed to g_app_info_launch?

Passing such information is inherently tied to a mode of implementation
of launching the application. You spawn a new process from scratch with
certain initial state. That might very well not be what is happening. We
might just contact an already running copy of the app and tell it to
open the file. Things like changing the env or the cwd of the app then
just makes no sense.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]