• 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: "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
  • Follow-Ups:
    • Re: Converting an Absolute path to a relative path?
      • From: Chris Ridd <email@hidden>
    • Re: Converting an Absolute path to a relative path?
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Converting an Absolute path to a relative path? (From: Chris Ridd <email@hidden>)

  • Prev by Date: Notification to NSApp Strangeness
  • Next by Date: Re: [ANN] Project distribution tool Verpack
  • 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