Read file on compiler time.
Remo via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu May 29 13:38:29 PDT 2014
On Thursday, 29 May 2014 at 20:21:32 UTC, Adam D. Ruppe wrote:
> string a = import("file.txt");
>
> dmd yourprogram.d -Jlocation_of_file
>
>
> so for example
>
> dmd yourprogram.d -J.
>
>
> if file.txt is in the same directory as the .d file.
Excellent, thank you Adam!
Now another question is it also possible to save/write string at
compile time?
Probably no...
Any way I like CTFE !
More information about the Digitalmars-d-learn
mailing list