Compile time filesystem access?

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Jan 30 05:29:58 PST 2012


Only with `enum xmldata = import("file.xml");`, but you have to pass
the -J switch and a directory path for the location of the file. E.g.:

module test;
enum xmldata = import("file.xml");
void parse(string data)() { }
void main() {
    parse!(xmldata)();
}

$ dmd -J. test.d

"." is short for the current dir of course.


More information about the Digitalmars-d mailing list