Resource File Accessing

Plummtw sailormoontw at
Sun Dec 28 18:11:22 PST 2008

>Jarrett Billingsley Wrote:
> Easier even than that.  The import() expression allows you to include
> arbitrary data in your app.
> const data = cast(byte[])import("filename.dat");
> All you have to do is pass the -J flag to DMD to indicate the path
> where filename.dat lives.  import() returns a string (a char[]) but
> you can cast it to whatever type you want, like I've casted to byte[]
> here.  :)
   Oh...Thanks for the answer...

More information about the Digitalmars-d mailing list