Read file on compiler time.

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 29 13:21:31 PDT 2014


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.


More information about the Digitalmars-d-learn mailing list