[9340] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: file selection dialog
daemon@ATHENA.MIT.EDU (Scott Stone)
Thu Oct 15 16:39:27 1998
Date: Fri, 16 Oct 1998 05:36:23 +0900 (JST)
From: Scott Stone <sstone@ume.pht.co.jp>
To: gtk-list@redhat.com
In-Reply-To: <Pine.LNX.3.96.981015211628.18588M-100000@turing.idc.ul.ie>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
On Thu, 15 Oct 1998 padraig@turing.idc.ul.ie wrote:
>
> hi,
>
> when you collect the filename from the file selection dialog using
>
> filename = gtk_file_selection_get_filename( GTK_FILE_SELECTION(fs) );
>
> it returns the full path of the filename. my question is: is there any
> quick way to get just the filename (i.e. without the path) or do you
> have to extract it (from the longer string) yourself?
It's easy, just:
char *s1=rindex(filename,'/');
s1++;
now, s1 is your base filename, without the path.
>
>
> thx,
>
> Padraig.
>
> --
> Padraig Finnerty www.csn.ul.ie/~padraig
> Interaction Design Centre www.idc.ul.ie
> University Of Limerick www.ul.ie
>
>
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
>
--------------------------------------------------
Scott M. Stone <sstone@pht.com, sstone@turbolinux.com>
<sstone@pht.co.jp>
Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)
http://www.pht.com http://armadillo.pht.co.jp
http://www.pht.co.jp http://www.turbolinux.com
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null