FROM : Gerriet M. Denkmann
DATE : Sun Apr 20 10:19:11 2008
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.
DATE : Sun Apr 20 10:19:11 2008
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.
| Related mails | Author | Date |
|---|---|---|
| Gerriet M. Denkman… | Apr 20, 10:19 | |
| stephen joseph but… | Apr 20, 10:46 | |
| stephen joseph but… | Apr 20, 10:51 | |
| Jean-Daniel Dupas | Apr 20, 11:59 | |
| Gerriet M. Denkman… | Apr 20, 12:18 | |
| Jim Correia | Apr 20, 15:15 | |
| Jens Alfke | Apr 20, 18:10 |






Cocoa mail archive

