How to embed data within an executable?

bearophile bearophileHUGS at lycos.com
Sun Feb 2 08:52:37 PST 2014


Gary Willoughby:

> I'm using DMD to create an executable and wondered what is the 
> best way to embed data into it.
>
> For example, i want to embed base64 image data in the 
> executable then access it during runtime. Is this possible? if 
> so how?

There are various ways to do it. If your data is not too much, 
one way is to use a "hex string". You can also use 
mixin(import("...")).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list