Re: [RESOLVED] [[NSBundle mainBundle] bundlePath] and trailng slashes...
Re: [RESOLVED] [[NSBundle mainBundle] bundlePath] and trailng slashes...
- Subject: Re: [RESOLVED] [[NSBundle mainBundle] bundlePath] and trailng slashes...
- From: Chase <email@hidden>
- Date: Mon, 18 Jul 2005 18:23:10 -0500
On Jul 18, 2005, at 6:19 PM, Douglas Davidson wrote:
On Jul 18, 2005, at 4:06 PM, Chase wrote:
the problem is that i'm looking for a path in the com.apple.dock
prefs domain and i need to compare it to my bundle path to see if
my app is already in the dock. the paths in the dock seem to all
have trailing slashes, but i don't want to depend on that, since
any user could certainly pop open the plist file and add a
pathname that doesn't have a trailing slash.
Unfortunately, path comparison is not necessarily simple. A
trailing slash is not the only non-significant change that can be
made; there are also issues such as repeated slashes (// is
equivalent to /) and the use of dots (/./ is equivalent to /, and
then there is also .. to be considered). Symlinks can also confuse
the issue, whether or not you wish them to be significant. You can
look at the documentation for stringByStandardizingPath et al. for
more information on some of the operations available to you.
Douglas Davidson
what about comparing alias datas? that would be more reliable
wouldn't it? doesn't that circumvent the symlinks issue?
- chase
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden