## Multifile Devices And Directory Files

Multifile devices are mass storage devices (usually disk systems) that store data organized into separate logical entities called “files”. Each file has a name which is entered in a directory file. Every multifile device has a master directory (called the “root directory”) that includes the names of the files and sub-directories stored on the device. The root directory is created automatically when the disk is initialized by the format command.

Pathlists that refer to multifile devices may have more than one name. For example, to refer to the file “mouse” whose name appears in the root directory of device “D1” (disk drive one) the following pathlist is used:

/d1/mouse

When OS-9 is asked to create a path, it uses the names in the pathlist sequentially from left to right to search various directories to obtain the necessary routing information. These directories are organized as a tree-structured hierarchy. The highest-level directory is called the “device directory”, which contains names and linkages to all the I/O devices on a given system. If any of the devices are of a multifile type they each have a root directory, which is the next-highest level.

The diagram below is a simplified file system tree of a typical OS-9 system disk. Note that device and directory names are capitalized and ordinary file names are not. This is a customary (but not mandatory) practice which allows you to easily identify directory files using the short form of the dir command.

                          System Device Directory
                  +---------------------------------+
                  !            !          !         !
                  D0          TERM        P         D1
                  !                                 !
                  !                                 !
                  !                                 !
          D0 Root Directory                 D1 Root Directory
      +----------------------+           +----------------------+
      !           !          !           !          !           !
    DEFS      startup      CMDS        file1      file2        file3
      !                      !
      !                      !
      !                      !
    --+--         +-----+----+-----+-----+
      !           !     !    !     !     !
    OS9Defs     copy  list  dir   del  backup

The device names in this example system are “TERM”, “P”, “D0” and “D1”. The root directory of device “D0” includes two directory files, `DEFS` and `CMDS`, and one ordinary file “startup”. Notice that device “D1” has in its root directory three ordinary files. In order to access the file “file2” on device “d1”, a pathlist having two names must be used:

    list /d1/file2

To construct a pathlist to access the file “dir” on device “d0” it is necessary to include in the pathlist the name of the intermediate directory file `CMDS`. For example, to copy this file requires a pathlist having three names to describe the “from” file:

    copy /d0/cmds/dir temp