[fpc-pascal] Re: Fpc Access Violation if AppConfigDir doesn't exist.
bartjunk64 at gmail.com
Sat Feb 9 14:56:34 CET 2013
On 2/9/13, Michael Van Canneyt <michael at freepascal.org> wrote:
> Like I said, we can imagine a parameter 'AllowCreate' or 'ForceCreate'.
GetAppConfigDir(Global : Boolean: ForceCreate: Booelan = false) : String;
While this can easily be implemented without breaking existing code,
this still does not solve the original problem.
If creating the directory fails, the function does not return an
errorcode, unless we decide to let it raise an exception in this
Common programming sense would be to query the desired location, and
if it does not exists, try and create it,(for this the ForeceCreate
parameter is usefull) __and check__ if this went OK.
So, no matter how we change the GetAppConfigDir() function, it will
always require code for checking if all went OK.
More information about the fpc-pascal