[Top][All Lists]

[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,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]