[Vala] Fwd: Getting path to my program's directory






Begin forwarded message:

From: pancake <pancake youterm com>
Date: December 5, 2009 9:21:54 AM GMT+01:00
To: Mark Dewey <dewemark gmail com>
Subject: Re: [Vala] Getting path to my program's directory


Can you read the documentation? It is there for something, in case of doubt there's always the source code and then the irc.

GtkFileChooser opens in curdir.. So it works if you do ./foo. There are functions in glib that may help to do it. Just parse argv0 or even better, just use glib

http://references.valadoc.org/glib-2.0.html

See glib.environment namespace

Are you serious about opening dialogs to get a string representing the path to the program? I can't believe it srsly

On Dec 5, 2009, at 4:06 AM, Mark Dewey <dewemark gmail com> wrote:

Arkadi Viner wrote:
Hi guys.
I need to execute some program which is located in my program's directory.
Is there any API to get the path to my program's directory?
Thanks.

I found an unlikely solution that works for me, although it requires Gtk
(so it's not Vala specific—can we answer seemingly Vala-specific
questions with non-Vala-specific answers here?)
• Make a Gtk.FileChooserDialog
• Call its get_current_folder method (it's your program directory by default, or at least it's mine on Ubuntu 9.10—it'd be nice to know if it
worked on other operating systems, too, though.

_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list



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