• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Converting an Absolute path to a relative path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting an Absolute path to a relative path?


  • Subject: Re: Converting an Absolute path to a relative path?
  • From: Chris Ridd <email@hidden>
  • Date: Sun, 19 Sep 2004 07:53:47 +0100

On 18/9/04 10:01 pm, M. Uli Kusterer <email@hidden> wrote:

> 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?

Multiple adjacent "/" characters get merged together. In XCode try "Open
Quickly..." and type in "/usr///include/stdio.h", or "more
/usr///include/stdio.h" from the terminal.

>> 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.

Yes, that is true.

>> Sorry if I'm giving you both egg-sucking instructions ;-)
>
>   I think my English is failing me here ?

Sorry. In English/American there's a colloquial expression "teaching your
grandmother to suck eggs", ie something she already knows how to do.

Cheers,

Chris


 _______________________________________________
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

References: 
 >Re: Converting an Absolute path to a relative path? (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Unicode replaceOccuranceOfString?
  • Next by Date: Re: Unicode replaceOccuranceOfString?
  • Previous by thread: Re: Converting an Absolute path to a relative path?
  • Next by thread: RE: Converting an Absolute path to a relative path?
  • Index(es):
    • Date
    • Thread