Re: Best way to build relative pathname?
Re: Best way to build relative pathname?
- Subject: Re: Best way to build relative pathname?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Mon, 12 May 2003 14:30:13 +0200
At 11:32 Uhr +0200 12.05.2003, Lorenzo wrote:
In Project Builder you can easily take a look at the
"NSString (Objective C)" help file or "NSPathUtilities.h" file
To do that (if you don't know yet) go to the Find panel
then start a search for "NSPathUtilities". Then click on the "book" icon in
the result list.
Lorenzo,
yes, I found NSPathUtilities. But what I actually need is to go
FROM:
"/Users/witness/Documents/file.jpg"
and "/Users/witness/"
TO:
"Documents/file.jpg"
Where the paths can be arbitrary. What I'm currently doing is finding
the range of the second path (folder path) in the first path (file
path) and then delete that range from the string, which gets me the
proper result in the most common case.
Sadly, if the file path was "/Users/file.jpg", the correct relative
pathname would be "../file.jpg", which this obviously won't yield.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.