<!-- Converted to DocBook/SGML by Kevin Conder -->
<section id="OrchDirFiles">
  <title>Directories and Files</title>

  <para>
    Many generators and the Csound command itself specify filenames to be read from or written to. These are optionally full pathnames, whose target directory is fully specified. When not a full path, filenames are sought in several directories in order, depending on their type and on the setting of certain environment variables. The latter are optional, but they can serve to partition and organize the directories so that source files can be shared rather than duplicated in several user directories. The environment variables can define directories for soundfiles SFDIR, sound samples SSDIR, sound analysis SADIR, and include files for orchestra and score files INCDIR.

    <indexterm id="IndexSFDIR"><primary>SFDIR</primary></indexterm>
    <indexterm id="IndexSSDIR"><primary>SSDIR</primary></indexterm>
    <indexterm id="IndexSADIR"><primary>SADIR</primary></indexterm>
    <indexterm id="IndexINCDIR"><primary>INCDIR</primary></indexterm>
  </para>

  <para>
    The search order is:
    <orderedlist>
      <listitem>
        <para>Soundfiles being written are placed in SFDIR (if it exists), else the current directory.</para>
      </listitem>

      <listitem>
        <para>Soundfiles for reading are sought in the current directory, then SSDIR, then SFDIR.</para>
      </listitem>

      <listitem>
        <para>Analysis control files for reading are sought in the current directory, then SADIR.</para>
      </listitem>

      <listitem>
        <para>
          Files of code to be included in orchestra and score files (with <link linkend="include"><citetitle>#include</citetitle></link>) are sought first in the current directory, then in the same directory as the orchestra or score file (as appropriate), then finally INCDIR.
        </para>
      </listitem>
    </orderedlist>
  </para>

  <para>
    Beginning with Csound version 3.54, the file <quote>csound.txt</quote> contains the messages (in binary format) that Csound uses to provide information to the user during performance. This allows for the messages to be in any language, although the default is English. This file must be placed in the same directory as the Csound executable. Alternatively, this file may be stored in SFDIR, SSDIR, or SADIR. Unix users may also keep this file in <quote>/usr/local/lib/</quote>. The environment variable CSSTRNGS may be used to define the directory in which the database resides. This can be overridden with the <emphasis>-j</emphasis> command line option. (New in  version 3.55)
    <indexterm id="IndexCSSTRNGS"><primary>CSSTRNGS</primary></indexterm>
  </para>
</section>
