Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-07

GetAppConfigDir confusion

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ales Katona

It seems that currently, GetAppConfigDir performs rather incosistently.

On Unix, it returns path with trailing pathdelim, on windows it returns path with random trailing path delim (depends on which branch, see code).

What should it be then?

Considering the importance of this function to programs, it's changes along versions (e.g: 2.2.0 vs 2.2.2 vs soon-to-be-trunk) I think we need to document the behaviors per-version so people can decide if it's even viable to use atm. (I got burned).

So.. questions are:
1. trailing pathdelims, yes or no? (of course only if there's something to return)
2. can I update the doc with per-version peculiarities info?

Ales

Reply by email

Michael Van Canneyt
to Ales Katona
Ales Katona wrote 15 lines
It seems that currently, GetAppConfigDir performs rather incosistently. On Unix, it returns path with trailing pathdelim, on windows it returns path with random trailing path delim (depends on which branch, see code). What should it be then? Considering the importance of this function to programs, it's changes along versions (e.g: 2.2.0 vs 2.2.2 vs soon-to-be-trunk) I think we need to document the behaviors per-version so people can decide if it's even viable to use atm. (I got burned). So.. questions are: 1. trailing pathdelims, yes or no? (of course only if there's something to return)

What is the most logical according to you ?

2. can I update the doc with per-version peculiarities info?

I'll take care of this.

Michael.

Reply by email

Ales Katona
to Michael Van Canneyt

Michael Van Canneyt wrote / napísal(a):

Show quoted text 22 lines
On Tue, 29 Jul 2008, Ales Katona wrote: > It seems that currently, GetAppConfigDir performs rather incosistently. > > On Unix, it returns path with trailing pathdelim, on windows it returns path > with random trailing path delim (depends on which branch, see code). > > What should it be then? > > Considering the importance of this function to programs, it's changes along > versions (e.g: 2.2.0 vs 2.2.2 vs soon-to-be-trunk) I think we need to document > the behaviors per-version so people can decide if it's even viable to use atm. > (I got burned). > > So.. questions are: > 1. trailing pathdelims, yes or no? (of course only if there's something to > return) > What is the most logical according to you ?

I think the pathdelim should be there so people can simply add name of their file to it. That's how it currently works in unix, and I think it's the most logical solution. Loesje said he'll look into it but I can help, after someone confirms which way to go :)

Show quoted text 6 lines
> 2. can I update the doc with per-version peculiarities info? > I'll take care of this.

Thanks

Show quoted text 6 lines
Michael. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Michael Van Canneyt
to Ales Katona
Ales Katona wrote 32 lines
Michael Van Canneyt wrote / napísal(a): > On Tue, 29 Jul 2008, Ales Katona wrote: > > > > It seems that currently, GetAppConfigDir performs rather incosistently. > > > > On Unix, it returns path with trailing pathdelim, on windows it returns > > path > > with random trailing path delim (depends on which branch, see code). > > > > What should it be then? > > > > Considering the importance of this function to programs, it's changes > > along > > versions (e.g: 2.2.0 vs 2.2.2 vs soon-to-be-trunk) I think we need to > > document > > the behaviors per-version so people can decide if it's even viable to use > > atm. > > (I got burned). > > > > So.. questions are: > > 1. trailing pathdelims, yes or no? (of course only if there's something to > > return) > > > > What is the most logical according to you ? > I think the pathdelim should be there so people can simply add name of their file to it. That's how it currently works in unix, and I think it's the most logical solution. Loesje said he'll look into it but I can help, after someone confirms which way to go :)

Well, I think adding it is indeed the most logical. Probably the confusing windows situation is the result of some bug fix not being merged correctly.

I'll add a warning that prior to 2.2.2, the behaviour may be inconsistent.

Michael.

Reply by email

Marc Weustink
to Ales Katona: It seems that currently, GetAppConfigDir performs rather incosistently. On Unix, it…
Ales Katona wrote 6 lines
It seems that currently, GetAppConfigDir performs rather incosistently. On Unix, it returns path with trailing pathdelim, on windows it returns path with random trailing path delim (depends on which branch, see code). What should it be then?

:)

This is exactly the reason why I at work created the utility function:

   function ConcatinatePath(const Elements: array of string): String

so it will take cate if a delim exist or not for the individual parts. (especially when users may define a dir)

Marc

Reply by email

Michael Van Canneyt
to Inoussa OUEDRAOGO
Inoussa OUEDRAOGO wrote 10 lines
>> So.. questions are: >> 1. trailing pathdelims, yes or no? (of course only if there's something to >> return) > > What is the most logical according to you ? For consistency purpose ( think of ExtractFileDir and ExtractFilePath ), why not define * GetAppConfigDir : without pathdelim * GetAppConfigPath : with pathdelim

I don't want to burden the API too much; ExtractFileDir is an old left over from DOS days; The logical thing there is to use is ExtractFilePath - which has the path delimiter, which is why I think that a trailing path delimiter should be used.

Michael.

Reply by email