getting __DIR__ and __TIME__ of compilation?

Ravn ravndust at gmail.com
Fri Dec 27 10:14:58 PST 2013


On Friday, 27 December 2013 at 15:23:37 UTC, Marco Leise wrote:
> No, but if you just want the path where your sources are you
> could use __FILE__ for any module and cut off the part of
> it that belongs to the module path. A lot of Phobos works at
> compile time, so you might be able to write a one-liner for
> that.

I need the absolute path __FILE__ during compile time,
so far the only way I know to get absolute paths is by using 
std.path.absolutePath (which uses getcwd() as its base) and 
getcwd() itself (which doesn't seem to work during compile time).

Is there any alternative on how to get the absolute path for a 
file during compile time besides using these functions?


More information about the Digitalmars-d-learn mailing list