[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in NSUser.m - NSSearchPathForDirectoriesInDomains()
From: |
Richard Frith-Macdonald |
Subject: |
Re: Bug in NSUser.m - NSSearchPathForDirectoriesInDomains() |
Date: |
Mon, 21 Jul 2003 13:50:41 +0100 |
On Monday, July 21, 2003, at 12:58 PM, Roland Schwingel wrote:
Hi...
As of the fact that today seems to be the "Send-in-a-bug" day, I also
want to contribute to this...
Well...There is a bug in NSUsers NSSearchPathForDirectoriesInDomains()
function.
This function should return a NSArray containing all directories to
search. The function itself builds up a list of directories and then
checks this list whether all entries are present in the filesystem.So
it should check the presence of each individual directory.
Unfortuanately it doesn't check for folders it checks for files (using
NSFileManager's -fileExistsAtPath: and not
-fileExistsAtPath:isDirectory:) so it cannot succeed here. My attached
patch will fix this.
But ... the -fileExistsAtPath: method is supposed to return YES if the
path specifies a directory.
So, if it's returning NO, there is a bug in the -fileExistsAtPath:
implementation rather than a bug
in respect of whether it is used or -fileExistsAtPath:isDirectory: is
used.
In fact, since -fileExistsAtPath: is implemented as a call to
-fileExistsAtPath:isDirectory:, I can't
see how your patch can possibly fix any problem there might be.