[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Newbie question about path
From: |
Tima Vaisburd |
Subject: |
Newbie question about path |
Date: |
Thu, 17 Jul 2003 10:58:50 -0700 |
User-agent: |
KMail/1.4.3 |
Hello everybody,
What is the best way to convert relative path to absolute path?
I came up to
NSString * AbsolutePath(NSString * path)
{
if ( ! [path isAbsolutePath] )
{
NSFileManager * fmgr = [NSFileManager defaultManager];
NSString * dir = [fmgr currentDirectoryPath];
NSArray * arr = [NSArray arrayWithObjects: dir, path, nil];
path = [[NSString pathWithComponents: arr] stringByStandardizingPath];
}
return path;
}
Thanks you,
Tima.
- Newbie question about path,
Tima Vaisburd <=