Binary with appended zip-file

Frank Benoit keinfarbton at googlemail.com
Sun May 20 09:11:26 PDT 2007


Henning Hasemann schrieb:
> Okay this might be of topic, if so sorry for posting this.
> 
> I'm about to build a little SDL-application which should run completely
> from a single binary.
> So my idea was to simple append a .zip-file with all other needed
> files (images etc..) to it and extract it in RAM with std.zip.
> 
> The big problem is: How does the program know where in the binary the zip-file
> begins?
> Naturally this information is only available *after* compilation
> (its the size of the plain binary then) but how can I insert
> it to the program after it has been compiled?
> 
> I could reserve the space for a size-variable and compile with the dropped-in
> value a second time but maybe someone has a better idea?
> 
> TIA
> Henning


There are two binary to D converter i know of:
* www.dprogramming.com
* in the tioport project, the bintod folder

So you can compile the zip into a ubyte[] and link it to your sources,
then your app can simply read it.



More information about the Digitalmars-d mailing list