[fpc-devel] Re: ExtractFilePath and GetAppConfigDir issues

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Sep 12 12:52:10 CEST 2007


Umm... This makes me think.  Is there maybe some undocumented (I
haven't found anything yet) feature that says all functions that end
in *Dir  will return a directory _without_ a ending directory
separator.  And all functions that end in *Path will return a
directory _with_ a directory separator.   :)

Either way I still think - Always include the separator or never
include the separator!

Graeme.



On 12/09/2007, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> Oh, and here is another one!
>
> ExtractFileDir  which to me does the exact same thing as
> ExtractFilePath, but this one has NO ending directory separator.
>
> Graeme.
>
>
>
> On 12/09/2007, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> > Hi,
> >
> > I find the following inconsistent and have to constantly check for
> > ending path delimiters because I am never sure which functions include
> > them and which doesn't.
> >
> >
> > Both the following functions returns a path, yet one includes a
> > trailing path delimiter and the other doesn't!  Why can't all
> > functions that return a path include or exclude the trailing path
> > delimiter.  A mix of the two is just plain annoying!
> >
> >
> > GetAppConfigDir(False)
> >   returns:  /home/graemeg/.config
> >
> > ExtractFilePath('/home/graemeg/.config/testing.xml')
> >   returns:  /home/graemeg/.config/
> >
> >
> > Why does one have a trailing '/' and the other not?  They are both paths!
> >
> >
> > Regards,
> >   - Graeme -
> >
>



More information about the fpc-devel mailing list