home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #3.1 / RBBSIABOX31.cdr / dosc / dos20.txt < prev    next >
Encoding:
Text File  |  1984-08-17  |  7.1 KB  |  163 lines

  1.                        MS-DOS 2.0
  2.  
  3.                 TREE-STRUCTURED DIRECTORIES    
  4.  
  5.     One of the most powerful features of MS-DOS 2.0 is its 
  6. ability to use multiple directories in a tree-like-structure. 
  7. The Columbia 1600-4 hard drive is limited to 318 files in its
  8. main directory, but it can handle thousands of files in
  9. subdirectories in a hierarchical, or tree-like structure.
  10.  
  11.     The concept of a tree-structured directory is similar to
  12. that of a family tree.  There is one "root" directory and all  
  13. other directories are like  "children," able to trace their
  14. lineage back to their "first ancestor" (the root directory).
  15. You can have as many "generations" of directories as you
  16. like, but you can only move about in this "family" tree
  17. structure in a direct path that goes from "parent to child"
  18. or "child to parent".  A path may go from "root" to "parent"
  19. to "child", but it cannot go directly to "child" without
  20. passing through "parent".  Each directory can contain program
  21. and data files as well as its descendant sub-directories. 
  22. Below is an example of a typical tree-like directory
  23. structure.
  24.  
  25. @BEGIN(VERBATIM)
  26.  
  27.                         ROOT  DIRECTORY
  28.                 ------------------------------
  29.                   /       |        |             \
  30.            PROGRAMS      BIN    LANGUAGES       USERS
  31.           ----------     ---    ---------    -----------
  32.          /    |     \                       /     |     \
  33.     WRITER  CALC  FGRAPHS                 BOB    SUE    JOE 
  34.     ------  ----  -------                 ---    ---    ---
  35.       |                                           |
  36.    PRINTING                                       TEXT
  37.    --------                                  ----
  38.  
  39.  
  40.  
  41.               Figure 1.  Example Tree Structure
  42.  
  43. @END(VERBATIM)
  44.  
  45.     Before loading numerous files on a hard disk it may be
  46. useful to plan a directory structure.  Note the sub-directory
  47. named BIN in the example above.  This type of directory is
  48. sometimes used to hold MS-DOS utilities so that the root
  49. directory contains only the names of its sub-directories and is
  50. not cluttered up with the many DOS files. 
  51.  
  52.     MS-DOS provides commands to use this tree-like directory
  53. structure.  They are:
  54. @BEGIN(VERBATIM)
  55.         * MKDIR or MD - Make a new directory
  56.         * CHDIR or CD - Change the default (present) directory
  57.         * RMDIR or RD - Remove a directory
  58.         * PATH - Layout a pathway to search through sub-directories
  59.                    for a file if it is not on the present directory
  60.         * TREE - Display a listing of sub-directories
  61.         * HUNT - Find the sub-directory location of a file
  62. @END(VERBATIM)    
  63.     When a hard drive system first boots up, regardless of the
  64. directory structure, it comes up in the boot (root) directory.
  65.  
  66.      To build a subdirectory (LANGUAGES, for example), type the
  67. command MKDIR LANGUAGES.   
  68.  
  69.      You can copy files from the root directory into the
  70. subdirectory by typing COPY <filename> LANGUAGES. 
  71.  
  72.      Move from the root directory to the subdirectory by typing
  73. CHDIR LANGUAGES.  A DIR command from within a subdirectory will
  74. display the files in that subdirectory.  From the root directory,
  75. DIR LANGUAGES will display the files in the subdirectory named
  76. LANGUAGES.
  77.     
  78.     The symbol "\"  is known as the "path separator", and is
  79. used to separate the directories in a "path" from any file
  80. specified at the end of a path.  The symbol "\" can also be used
  81. as the first item in a path to tell your system to start at the
  82. root directory and move down a path, instead of having to type
  83. all the directory names for a path that goes up the tree and back
  84. down again.  As a general rule, the backslash symbol must be used
  85. whenever you are in a subdirectory and want to go to any other
  86. directory for a file, or when you are specifying a pathname.
  87.  
  88.      The MS-DOS 2.0 PATH command allows you to specify a "path"
  89. to be used in a search for a file. For example, if you type "PATH
  90. \LANGUAGE", MS-DOS 2.0 will first search the root directory, then
  91. the LANGUAGE directory for a file that it could not find in your
  92. present working directory.  This predefined "path" will stay
  93. resident until you change it.  You can see the defined "path" any
  94. time by typing PATH and pressing the Return key.  If you are
  95. logged onto the A: drive and want to call BASIC from the
  96. LANGUAGES subdirectory on drive C:;, the drive name must be
  97. included in the PATH command:
  98.  
  99.                  PATH C:\LANGUAGES
  100.  
  101.       Having defined the path (while still logged onto drive C:),
  102. you can switch to A: and call up BASIC by typing:
  103.  
  104.                     C:BASICA
  105.  
  106.        This is very useful when you have a copy protected BASIC
  107. program on a floppy diskette, especially when there is not enough
  108. room on the floppy for the system files, the COMMAND.COM file and
  109. BASICA.  After specifiying a path while logged onto C:, switching
  110. to A:, then calling BASIC, the BASIC prompt (OK) will be
  111. displayed on the screen.  Load and run the program you need from
  112. Drive A:.
  113.  
  114.        
  115. @BEGIN(VERBATIM)
  116.     The SUE sub-directory might look like this:
  117.  
  118.         Volume in drive C has label HARDDISK
  119.         Directory of C:\USERS\SUE
  120.  
  121. .        <DIR>        11-22-83        11:23a
  122. ..        <DIR>        11-22-83        11:23a
  123. TEXT        <DIR>        11-23-83        11:23a
  124. FILE1   EXE      16435    9-10-83         4:31p
  125. 4  File(s)   6457039 bytes free
  126. @END(VERBATIM)
  127.  
  128.     There is one file (FILE1.EXE) and one sub-directory (TEXT)
  129. in the SUE subdirectory.  The "." entry in this sub-directory
  130. stands for the working directory (in this case, the SUE
  131. subdirectory), and the ".." entry stands for the "parent"
  132. directory (in this case, the USERS subdirectory).  Both "." and
  133. ".." are present in all sub-directories.  The entry ".." can be
  134. used as a shortcut in a "path" to move to the parent directory. 
  135. Thus, to change to the USERS directory from the SUE directory,
  136. type "CHDIR ..".  
  137.  
  138.      To get a directory of all the directories on the disk, type
  139. @B(DIR ..) from the root directory.  All the files which do not
  140. have extensions will be displayed, and if they are directories,
  141. MS-DOS 2.0 reports it with a <DIR> message beside the directory
  142. name.
  143.  
  144.      It is important to avoid confusing the path from root to
  145. subdirectory to file with the PATH command.  The path between
  146. directories can be thought of as a pathWAY, while the PATH
  147. command is used primarily as a "roadmap" to let the MPC know
  148. which pathway to follow when looking for files. 
  149.  
  150.      To help find your way around a complex directory structure,
  151. you will find the MS-DOS 2.0 TREE command useful. It lists all
  152. the directories on the disk and their sub-directories.  The HUNT
  153. command will show you the sub-directory location of a file.
  154.  
  155.     "Getting around" in MS-DOS's tree structured directory may
  156. seem complicated at first.  But as you use directories, you will
  157. grow accustomed to them, and you will appreciate the ability to
  158. organize and structure your files.  The audio tutor cassette tape
  159. will guide you through a few practice exercises in using the
  160. structured directories, and the MS-DOS Reference Manual contains
  161. a detailed explanation of the directory structure in chapter 4 and
  162. a description of the commands that relate to it in chapter 5.
  163.