Re: file chooser dialog
- From: Roland Koebler <rk-list koebler com>
- To: gtk-app-devel-list gnome org
- Subject: Re: file chooser dialog
- Date: Mon, 31 Jul 2006 23:36:23 +0200 (CEST)
hi,
Does anybody also have an idea, how to realize the decision, if a path is
below another one (platform independent would be nice but not absolutely
necessary).
maybe there already is such a function in a library - I don't know.
but you can use glib. look here:
http://developer.gnome.org/doc/API/2.0/glib/glib-Miscellaneous-Utility-Functions
..html
Unfortunately the function must work with relative paths also (so tring
comparison is not possible).
look i.e. at: g_path_is_absolute, g_get_current_dir, g_build_path
with that, you can simply build an absolute path from a relative path.
example:
current = g_get_current_dir();
if( g_path_is_absolute(path) ) absolute = g_strdup( path );
else absolute = g_build_filename(current,path,NULL);
g_free(current);current=0;
....
g_free(absolute);absolute=0;
regards,
Roland
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]