Re: Current Working Directory
- From: Tor Lillqvist <tml iki fi>
- To: Nick Watts <fatalglory gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Current Working Directory
- Date: Wed, 17 Aug 2005 12:46:38 +0300
Nick Watts writes:
How can I set the cwd to the path my app is in?
Do you mean the process's working directory, or the file selector's
default directory? I'll answer the former.
char buffer[1000];
char *app_dir;
GetModuleFileName (NULL, buffer, sizeof (buffer));
app_dir = g_path_get_dirname (buffer);
g_chdir (app_dir);
g_free (app_dir);
(Untested. Add checks for error returns.)
--tml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]