getting __DIR__ and __TIME__ of compilation?

nazriel spam at dzfl.pl
Thu Dec 26 23:31:18 PST 2013


On Friday, 27 December 2013 at 06:39:54 UTC, Ravn wrote:
> Hi, I'm trying get the directory path and time at which the
> compilation was made (not when the program is run), something
> similar like this example in Haxe
> http://haxe.org/manual/macros#macro-functions
>
> Is it possible to do so in D?
> Something like __DIR__ and __DATE__ or __TIME__ in D traits 
> maybe?
> ( http://dlang.org/traits.html#specialkeywords )
>
> Thanks in advance
> -Ravn-

Hello.

Maybe this will work for you?
http://dpaste.dzfl.pl/3ad4aa3a

---
void main()
{
	import std.path: dirName;
	
	pragma(msg, dirName(__FILE__) ~ " " ~ __DATE__ ~ " " ~ __TIME__);
}
---


More information about the Digitalmars-d-learn mailing list