[ale] Resources in executables

J. Reeves Hall reeves at earthling.net
Thu Oct 21 13:12:45 EDT 1999


Kalin Nakov wrote:

> Hi. I have another Win32-to-UNIX porting question. Are there any standard
> way (maybe some libraries that can help?) to include resources (like
> bitmaps, music, binary data) in executables, or I should write them by
> myself? Such a thing can be very useful when writing a self-extracting
> executable.

I don't know if it's directly supported, but I don't see why you couldn't tack
the resources onto the end of the executable and retrieve the filename with
argv[0].

> And yet another simple thing to ask:
> What is the directory that usually holds
> 1. Applications (the equivalent of Program Files in Win32)

/usr/local/appname for some things, but it's more traditional to put binaries
in /usr/local/bin, libraries in /usr/local/lib, etc... Do NOT put things in
/usr/bin unless you are distributing this with a package management system; on
a Red Hat system, only rpm should mess with /usr/bin.
It's a good idea to allow the user to customize the installation directory.

> 2. Application configuration files (the equivalent of where System Registry
> or INI files are placed)

/etc is the config file directory, but it is rarely used by user programs.
It's better to put those config files in /usr/local/etc.

> 3. Application working (documents) directory (the equivalent of My
> Documents of Win32)

The user's home directory. You should allow the user to override this, though.
(for instance, I want my documents in /home/overcode/doc, not /home/overcode)
I believe the $HOME environment variable should give the name of the user's
home directory.

-Reeves

--
In a world without fences, why do we need Gates?
J. Reeves Hall - Georgia Tech (CS Major)
[overcode at resnet.gatech.edu]






More information about the Ale mailing list