|
From: | Richard Frith-Macdonald |
Subject: | Re: NSBundle -initWithPath: warning |
Date: | Sat, 02 Apr 2005 06:30:06 +0100 |
On 2005-04-02 06:12:10 +0100 Sheldon Gill <sheldon@westnet.net.au> wrote:
Richard Frith-Macdonald wrote:On 2005-04-02 04:37:19 +0100 Sheldon Gill <sheldon@westnet.net.au> wrote:I've looked over this some more and on this point I still think there is a case. The Foundation docs say it needs a "full path", not "thou shalt specify an absolute path".Yes, the term 'full path' is not completely clear/well-defined. However, it's hard to see exactly what it could mean if it's not a synonym for 'absolute path'. I guess it could just mean 'path', or perhaps it could mean 'path without tilde escapes'.I think you'll find that a tilde path works fine. It'll only be relative paths that cause problem when you change current directory.
Of course ... I was just intending to point out that interpreting 'full path' as anything other than a synonym for 'absolute path' is (while possible) really quite difficult/perverse.
So the question of 'correct' behaviour remains. I'd suggest the isAbsolute check and warning isn't needed. Maybe convert from relative to absolute.
The check is needed to convert from relative to absolute or to warn ... if you don't check, you don't know whether to convert or not or whether to warn or not. Of course, we could behave exactly like MacOS-X and neither convert nor warn ... just crash.
Personally, I'd go for the docs saying "use an absolute path because otherwise you'll encounter problems". The code doesn't check and leaves it to the programmer. {Or it checks in debug builds only}
I think the current GNUstep does it right ... it does all the most user friendly things it really can.
1. warn in the documentation. 2. warn at runtime (to remind people their code is not portable/safe) 3. work anyway ... so they can continue to test/debug their programSometime in the future Apple may 'fix' NSBundle and we can then remove 1 and 2
[Prev in Thread] | Current Thread | [Next in Thread] |