Re: [AD] Documentation update for unix specifics chapter

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> This patch tries to clarify a little bit the order of file paths Allegro
> searches for when looking for files. Talking about that, shouldn't text
> files be looked for also under /usr/local/etc? And since the search is
> from "personal" to "global", shouldn't the search for binary files be:
>
>    ./keyboard.dat
>    $ALLEGRO/keyboard.dat
>    ~/keyboard.dat
>    /usr/local/share/allegro/keyboard.dat
>    /usr/share/allegro/keyboard.dat
>    /etc/keyboard.dat

Indeed, that would appear to be more consistent.


+Under Unix resources are searched in many different paths. When a

Under Unix, resources ... searched for ...

+configuration resource is looked for, it is usually tried with the
+ variations
+`name.cfg' or `.namerc' in multiple paths: the current directory, the
+directory pointed by the ALLEGRO environment variable, the user's home

... pointed to ...

+directory and one or more global system directories to which usually only
+the root user has access to.

One superfluous 'to'.

+Text files, like the main allegro config file or a
+language text translation files are looked for in the following places:
+<textblock>
+   ./allegro.cfg
+   $ALLEGRO/allegro.cfg
+   ~/allegro.cfg
+   ~/.allegrorc
+   /etc/allegro.cfg
+   /etc/allegrorc
+<endblock>
+Binary resources like the keyboard mappings (keyboard.dat) or the language
+translation packfile (language.dat) are looked for in:

... translation files ...

+<textblock>
+   ./keyboard.dat
+   $ALLEGRO/keyboard.dat
+   ~/keyboard.dat
+   /etc/keyboard.dat
+   /usr/share/allegro/keyboard.dat
+   /usr/local/share/allegro/keyboard.dat
+<endblock>
+Note that if you have installed Allegro from the source distribution with
+the typical `<tt>make install</tt>', global files like `keyboard.dat', 
`language.dat'
+and `allegro.cfg' will not have been installed. As a system administrator
+you are required to install them manually wherever you prefer to have them.
+If you suspect that an Allegro program is somehow not finding the correct
+configuration file, you could try using the following command:
+<textblock>
+   strace program 2>&1|egrep "(open|stat)"
+<endblock>
+The strace program traces system calls and signals. By default it outputs
+the information to stderr, so that's we redirect it to stdin with

Missing 'why'?

+ `<tt>2>&1</tt>'.
+Since we are interested only in files being opened or not, we restrict the

..in files being (un)successfully opened...

+output of the log to stat or open calls with the extended grep command. You
+could additionally add another grep to filter only lines with text like

Redundancy: 'add.... add'.

+`keyboard' or `allegro'.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/