Re: Converting an Absolute path to a relative path?
Re: Converting an Absolute path to a relative path?
- Subject: Re: Converting an Absolute path to a relative path?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Sat, 18 Sep 2004 23:01:56 +0200
At 19:33 Uhr +0100 18.09.2004, Chris Ridd wrote:
This sort of conversion is notoriously difficult to get completely right...
Are you dealing correctly with multiple slashes in a path (e.g. foo//bar)
and links?
Actually, I thought that "//" was invalid in a path, so I'm not even
accounting for them. What do they do?
I *think* the only foolproof way to do it is to use chdir to the absolute
path, and then chdir("..") until you end up in the folder with an inode the
same as the intended base.
Well, that only works when the path you're working with actually
exists... That's also why I'm not accounting specially for links.
Sorry if I'm giving you both egg-sucking instructions ;-)
I think my English is failing me here ?
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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