[haiku-development] Re: [problem] Strange behavior of find_directory(B_USER_SETTINGS_DIRECTORY)

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 23 Jul 2009 12:47:42 +0200 CEST

Alex Hitech <ahitech@xxxxxxxxx> wrote:
> BPath* pathToSettings = NULL;
> FILE* settingsFile;
> ........
> if ( (find_directory (B_USER_SETTINGS_DIRECTORY,
> pathToSettings,
> false, NULL) != B_OK ) ||

You are using find_directory() in the wrong way.
Just have a look at its documentation - how can it set pathToSettings 
when it does not even have write access to its location? pathToSettings 
has to point to an existing BPath object.

BPath path;
find_directory(..., &path, ...)

Bye,
   Axel.


Other related posts: