[cfe-dev] Getting absolute path
Daniel Dunbar
daniel at zuster.org
Wed Sep 29 10:01:45 PDT 2010
On Mon, Sep 27, 2010 at 9:12 AM, Chris Lattner <clattner at apple.com> wrote:
>
> On Sep 27, 2010, at 12:56 AM, Pisit Makpaisit wrote:
>
>> I want to get file path in clang and I use getDir() in FileEntry. The result is I get relative path of that file. How can I get the file's alsolute path?
>
> If your system supports it, the BSD "realpath" function will do it.
Argh, never use realpath()!
You can just use the sys::Path::makeAbsolute function, we don't handle
the "working directory" of the compiler in any special fashion (yet).
- Daniel
> -Chris
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
More information about the cfe-dev
mailing list