====== DIRS.TXT ======

''DIRS.TXT'' is a plain text listing of file directories and their descriptions, one per line, of the kind shipped on shareware CD-ROMs so that a BBS could create matching file areas without typing them all in. The same listing is often distributed under the name ''DIRS.WIN'' or ''00_INDEX.TXT''.

[[util:SCFG]] both imports and exports this format, via the //Import Areas...// and //Export Areas...// options in a file library's directory list. See [[config:file_areas]].

This is **not** the obsolete Synchronet ''DIRS.TXT'' file area import/export format, which used 20 lines per area terminated by ''***END-OF-DIR***''. That format was retired in v3.22 and replaced by ''*dirs.ini'' -- see [[dev:chopping_block]].

===== Format =====

A plain text file, one line per file directory. Each line is a path followed by whitespace and a description:

<code>
GAMES/ARCADE                   Arcade and Action Games
GAMES/ADVENTURE                Adventure and Role-Playing Games
UTILS/ARCHIVE                  Archivers and Compression Utilities
GRAPHICS                       Image Viewers and Artwork
</code>

The path is relative to the library's parent directory (the //Parent Directory// setting of the file library being imported into or exported from), so the listing stays valid wherever the CD-ROM is mounted or copied.

===== Importing =====

SCFG looks in the library's parent directory for ''DIRS.WIN'' first, then ''DIRS.TXT'', then ''00_INDEX.TXT'', importing the first one it finds. You can type a different path at the prompt.

Each line is parsed as follows:

  * Blank lines and lines containing only whitespace are ignored.
  * Any leading ''/'' or ''\'' is stripped.
  * The first whitespace-delimited word is the directory's **path**. Backslashes are converted to forward slashes and a trailing slash is removed.
  * The rest of the line is the directory's **description**, used as the long name. Parsing skips ahead to the first alphanumeric character, so punctuation used as a separator (a dash or colon between path and description, for example) is discarded rather than becoming part of the name.
  * The **internal code** is taken from the last component of the path, with the library's code prefix applied.
  * The **short name** is as much of the trailing path as will fit; if the line carries no description, the path is used as the long name too.
  * Every other setting comes from the library's directory defaults.

If a listed path doesn't exist on disk, SCFG asks for confirmation before continuing -- expected when importing a listing for media that isn't mounted yet.

===== Exporting =====

Exporting writes ''DIRS.TXT'' in the library's parent directory by default, one line per directory in that library, and offers to overwrite or append if the file already exists.

The path is written left-justified in a 30-column field followed by the directory's long name. A path longer than 30 characters is not truncated -- it simply pushes the description further right, so columns won't line up for deeply nested paths.

===== See Also =====
  * [[:ref:|ref index]]
  * [[config:file_areas]]
  * [[dev:chopping_block]]

{{tag>format}}
