Search code examples
cross-platformconfiguration-filesfreepascallazarusfpc

How to obtain the config folder/file across platforms under Free Pascal/Lazarus?


Is there a set of functions that give you the file and/or the folder where to place an application's config?

I would like it to return the folder only and/or the file only on the appropriate place for each system.


Solution

  • The functions you are looking for are the following:

    Those functions will use the ApplicationName content to determine the name of the application. You can change that behaviour with the OnGetApplicationName callback.

    You can have a look at what they return for each system on the Multiplatform Programming Guide wiki page.