discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting an absolute file path


From: Wolfgang Lux
Subject: Re: getting an absolute file path
Date: Thu, 19 Sep 2013 17:00:09 +0200

Riccardo Mottola wrote:

> Hi,
> 
> I am chasing a strange error in ProjectCenter that drives me crazy.
> 
> Depending on how a project was opened, PC misbehaved. I tracked it down to 
> certain paths depending on the project path being absolute vs. relative. 
> Especially creations!
> 
> What's the best way (= portable also to windows) to get the absolute path of 
> a file or directory? I looked for methods in NSFileManager but found no easy 
> route.


In order to determine the absolute path you would need to know the base 
directory for the relative path. In case this is the directory of your project, 
you should query the NSDocument class or remember the path that was used to 
open the project. This is always an absolute path. You then can append the 
relative path to that directory using -stringByAppendingPathComponent:.

Wolfgang




reply via email to

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