System software:Directories

Directories

Because a hard disk can hold many hundreds or thousands of files, it is necessary to organize them into separate sections in the index. These sections are called directories, and they act rather like the sections in a library, separating files by subject matter or use. For example, the word processing software that you use may be held in one directory, and your record-keeping software in another. The text or data files that you create may be held in the same directories as the software, or you may find it convenient to house them in other directories.

(Floppy disks have a limited storage capacity and can therefore hold only a limited number of files. In this case it is not necessary to organize the files into directories, and operating systems that were developed before hard disks appeared - such as CP/M - are not able to handle directories.)

Directories are organized into what's called a tree struc­ture. To appreciate what this means, think of a directory as the branch of a tree:

• As a branch has leaves, so a directory has files.

• As a branch splits off into smaller branches which have their own leaves, so a directory may contain other subdirectories, each with their own files.

The basic directory which contains all other directories is called the root directory.

Figure 5.1 shows part of the directory structure of my hard disk. As you can see, I've called one of the directories QA, as this contains Q&A, the software package that I sometimes use for word processing and record keeping. This directory contains two subdirectories called DATA and TEXT; these hold the data files (for the record-keeping part of Q&A) and the text files (for the word processing part) respectively. Because I have so many text files, I find it convenient to have several subdirectories within TEXT, to separate out letters, files created by my wife, and so on. These are shown in the figure.

image

clip_image016

Naming files

To distinguish individual files within a directory, they must be given unique names. In many operating systems, includ­ ing DOS, a filename consists of two parts: the stem (the main part of the name) and an extension, separated by a dot. In CP/M and DOS, the stem can be up to 8 characters long, and the extension can be up to 3 characters long. You can use the stem to identify the contents of the file, and you may be able to use the extension to identify what type or class of file it is.

Most software dictates what the extension must be. For example, GrandView (the software I am using to write this book) adds the extension .GV to all files created by it. So the filename of this chapter is CHAP5.GV- I provided the stem, GrandView imposed the extension. (This file is in the directory of my hard disk called GV, along with the GrandView program files.)

In the case of program files, the operating system dictates the extension:

• In DOS and CP/M you can write your own batch program files to automatically execute batches of oper­ ating system commands (see your operating system manual), and you must give these the extension BAT.

• Some system files (i.e. files which are connected with the operating system) must have the extension SYS.

• Some program files must have the extension COM (short for command).

• Other program files must have the extension EXE (short for executable).

To run BAT, SYS, COM, and EXE files you can omit the extension and merely type the stem of the name. If there is a file of that name on the disk with one of these extensions, DOS or CP/M will run it.

clip_image017

Operating system commands

Although operating systems differ in their capabilities, some offering more facilities than others, they all perform the same types of tasks. Furthermore, many operating systems use similar commands, examples being the command COPY to copy a file, DELETE or DEL to delete a file, RENAME to rename a file, and, in the case of a program file, the file name itself in order to execute (i.e. run) it. In the following sections I shall deal with the main concepts and commands that are common to most systems. If you wish, you can bypass these and go straight to the section on operating environments on page 106.

As you read these sections, note the following points.

1 If you use a BBC micro, you must type a'*' before each of these commands, to tell the computer that you wish to step outside BASIC into the operating system.

2 You can type operating system commands in either upper or lower case. However, to help you to distinguish commands from other text in this chapter, I will use upper case throughout.

3 Many DOS commands incorporate a number of options, and you select which you want by:

• First typing the symbol'/' after the command.

• Then typing a letter specifying the option.

These options are called switches, for they allow you to switch the command to a different mode. For example, the DIR command, described below, which lists filenames down the left of the screen, can be switched to list them across the width of the screen by means of the 'W' switch:

DIR/W

clip_image018

Setting the current drive

Most microcomputer systems have two disk drives, which will be either a hard disk drive and one floppy, or two floppy drives. Many operating systems identify each drive by a letter: the first floppy drive is called Drive A, the second floppy drive is called Drive B, and the hard disk is called Drive C. If you are using a BBC micro, the drives are numbered 0, 1, etc.

The computer can only concentrate its attention on one drive at a time; the one that it is currently looking at is called the current drive. In the case of DOS or CP/M, when you turn the computer on the drive containing the operating system files will be the current drive; this will normally be either Drive C or, in the case of a system without a hard disk, drive A.

To change the current drive in DOS or CP/M, you simply type the drive letter followed by a colon. For example,

A:

will make the first floppy drive current, and

C:

will set the hard disk current.

clip_image019

Displaying the contents of a directory

The directory that you are in when you first power up the computer or switch drives is the root directory of the current disk. To display its contents (i.e. the files and subdirectories that it contains) you must enter the command

DIR

(which is short for 'directory'). Note that on some systems, such as the BBC micro, the command is CAT (which is short for 'catalogue'). This lists the filenames down the screen.

Comments

Popular posts from this blog

WORKED EXAMPLES ON PROCESS SPECIFICATION.

Why do we need information systems, management structure, requirements of information at different levels of management.

The User Interface:Establishing User Interfaces