Re: [gtk-list] file selection dialog



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




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