4.2 Disk Operating System (DOS)
4.2.2 DOS file structure
To understand basic DOS commands, first look at the structure of the disk shown in Figure . The way that programs and data are stored on a disk is set up much like a filing cabinet. Programs and data are stored the same way a document would be filed in a folder in a file cabinet. In DOS, they are called files and are grouped together in directories. Directories are much like the folders in the file cabinet. This process organizes the files and directories for easier retrieval and use. It would be very time consuming to find a single form in a file cabinet if the form were not held in a specific place. Directories can be nested inside other directories, just like a folder placed inside another folder. Nested directories are referred to as subdirectories. Directories became known as folders in the Windows OS.

What is a file?
A file is simply a block of logically related data that is given a single name and treated as a single unit. Examples include programs, documents, drawings and other illustrations, sound files, and so on. A record is kept of the location of every directory, subdirectory, and file found on a disk. The record is stored in a table called File Allocation Table (FAT). It is known as FAT32 in Windows 98 (FAT32 was introduced by Windows 95 OSR2). FAT32 is an improved version of FAT, and allows a more efficient use of disk space for storing file records (the similarities and differences between these file systems are discussed in Chapter 7). Files are referred to by filenames. In DOS, filenames can be up to eight characters with an extension of three characters. The extension is separated from the main portion of the filename by a period that identifies what type of file it is. An example of a DOS file name is mynotes.txt.

In DOS, all files have attributes, which are a set of parameters that describe a file. Given the attributes of a file, it is possible to determine the nature of the file. The common attributes for DOS files include the following:

  • Hidden File – The user will not see this type of file with any kind of normal file search in a DOS environment.
  • Read Only – The user can open and read this type of file but cannot write or modify the file in any way.
  • Archive (backup) status – Used by backup utilities to determine if a file needs to be backed up or not.
  • System File – A file needed by the DOS operating system for a successful bootup.

Hidden files conceal important files and keep them from being seen and possibly tampered with by unauthorized users. Hiding a file makes it invisible to a standard DOS directory listing and it can only be seen with a specific command. It is important to note that hiding a file does not make it immune to changes or access. The file is not listed in a standard DOS directory listing but it can still be accessed as a normal file. To see a hidden file, just use the command "dir /ah" at a command prompt as follows:

C:\>dir /ah

Directory Structures and Organization
Hard drives organize the disk into directories and subdirectories. The main directory is known as the root directory. All other directories, if they exist, then radiate (branch out) from the root directory, similar to the branches of a tree. In MS-DOS, a graphical representation of the disk drive's directory organization is called a directory tree. It is important to have a basic understanding of how DOS organizes disks when getting ready to prepare a hard disk drive for Windows installation.

Locating any given file requires knowledge of the drive, directory, and subdirectory in which the file is found. The first hard drive in most computer systems is labeled "C". Each hard disk in the computer can be considered a file cabinet or "root". The root of the C drive is represented by "C:\". Any files or directories within the root are represented by the root, followed by the name of the file or directory, such as C:\EXAMPLE. Any directory or file located within that directory is represented by that directory, followed by a backslash, followed by the name of the file or subdirectory, such as C:\EXAMPLE\FILE.EXE. In MS-DOS, the format for specifying the path to a file is as follows:

  • C:\directory name\subdirectory name\filename
    • The C:\ specifies the C disk drive of the computer
    • The back slash (\) after each item signifies the presence of a directory or subdirectory
    • The first back slash indicates the root directory, which is present on all DOS disks
Worksheet  (PDF, 6 KB)
  DOS