• 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
My private problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

My private problems


  • Subject: My private problems
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sun, 20 Apr 2008 10:19:11 +0200

I need an absolute path.

So I do:

NSFileManager *fima = [ NSFileManager defaultManager ];
NSString *fileType = [ [ fima fileAttributesAtPath: path traverseLink: NO ]; fileType ];
if ( [ fileType isEqualToString: NSFileTypeSymbolicLink ] )
path = [ fima pathContentOfSymbolicLinkAtPath: path ];


The problem is: "/tmp" is converted to "private/tmp" (Note the missing slash at the start).

Short of hardcoding a change from "private" to "/private" -
is there some Cocoa (or Carbon or bsd or whatever) way to get "/tmp" converted to "/private/tmp" (with the leading slash) ?
(Same problem exists for /etc and /var).


> ls -l /tmp
lrwxr-xr-x   1 root  gerriet  11 Feb  1  2007 /tmp -> private/tmp
But "cd /tmp" does not always do the same as "cd private/tmp".  Why?


Kind regards,

Gerriet.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: My private problems
      • From: Jens Alfke <email@hidden>
    • Re: My private problems
      • From: "stephen joseph butler" <email@hidden>
  • Prev by Date: Re: Implementing a Slightly Unusual NSTableView
  • Next by Date: Re: My private problems
  • Previous by thread: Re: KVO and Object Arrays
  • Next by thread: Re: My private problems
  • Index(es):
    • Date
    • Thread