Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!fernwood!oracle!news From: mroberts@oracle.uucp Newsgroups: comp.sys.atari.st.tech Subject: embedding a data file in an executable Message-ID: <1990Aug14.184530.26793@oracle.com> Date: 14 Aug 90 18:45:30 GMT Reply-To: mroberts@oracle.uucp () Organization: Oracle Corporation, Belmont, CA Lines: 19 I'd like to embed a data file in an executable (.PRG) file. The idea is that, when the program starts running, it can find its name with the appropriate OS call (shel_read, I believe), open the executable as a binary file, seek past the load image portion, and then start reading data. I've tried doing this the simple-minded way: figuring out how big the executable is, then hardcoding that size into the fseek(). This is just fine, until I actually append data to the end of the .PRG file. When I do, the program will not even load correctly, but bombs out with 3 or 4 bombs. Does anyone have any ideas about how to do this? I have the impression that GEM is continuing to read the data that I append to the executable as though it were more relocation table data. After reading the Mark Williams C documentation and nout.h and gemout.h, and dumping the executable itself, I still don't have a very good idea about how the loader actually works. Thanks, Mike Roberts mroberts@oracle.com