On Sat, 9 Feb 2013, Bart wrote:

On 2/9/13, Michael Van Canneyt <mich...@freepascal.org> wrote:

If creating the directory fails, the function does not return an
errorcode, unless we decide to let it raise an exception in this
case..


There is only one way:
if the ForceCreate is implemented and if creation fails, an exception
will be raised.

And in this case the OP still needs to do an extra check
(try..except), so basically this does not solve his "problem" because
it is unsolvable without the programmer checking/validating what
GetAppConfigDir did.

Which is why I always write the code to check/create the dir myself.

But having the check/create in a central place can have its advantages.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to