Custom Search
|
|
FILE AND DISK MANAGEMENT File and disk management are other areas where your knowledge will help users. They probably don't know the agony of delete or the problems sometimes caused by very large files. Think about what you have learned regarding file management. How to name files. How to cleanup files. How to back up files. When to back up files. Where and how to physically store files. How to protect files. How to organize files on disks. Let's examine some of the considerations for setting up files and file management procedures for microcomputers: naming files, disk file organization, and file backup. We will be using DOS as the operating system for the examples in this section. Naming Files Every newly created file must be given a file name if it is to be stored (written and given an address) on disk. When the operating system looks for a filename, it looks up the address in its "address book," the directory. The directory is maintained in a fixed location on every disk. Every operating system will have a system for naming files. In DOS, file names have two parts. The first part, the primary file name, names the file and can be from one to eight characters in length. The second part, called the file name extension, is optional, and can be from one to three characters. While the extension is optional, the primary part of the file name is NOT. An extension cannot name a file, it can only be used to further qualify or describe a file. If both parts are used, they must be separated by a period, for example, TELECOMM.TP7. To name a file (including its extension), you may use any combination of the following characters: the letters A through Z (upper and lower case), the numbers 0 through 9, the following special characters: $, #, !, %, ( ), -, { }, _, and the left and right apostrophe. Why would you want to use an extension? you might ask. Let's assume you created a file that contains all E-4 evaluations for the year 1997 and you named the file DIV-EVAL. It's a perfectly good and valid name under DOS. However, it is entirely possible you would want more than one file called DIV-EVAL, considering the years that follow. In this case, you might want to use the option of adding a file name extension. For example, you could label the 1997 evals DIV-EVAL.97, the next year's DIV-EVAL.98, the following year's DIV-EVAL.99, and so on. In this case, the years 97,98, and 99 are the extensions. Some extensions have special meanings in DOS and are either created by DOS or assume the file contains a special type of program or data. For this reason, use extreme caution and avoid using file extensions defined by the program or operating system you are using. Examples of extensions assigned by DOS are as follows: COM, EXE, SYS, BAT\ File extensions such as COM(mand), Executable), SYS(tem), and BAT(ch) contain executable code. That is, the code is actually understood by the hardware when programs are run. BAK\ When opening a text file, the DOS program automatically makes a backup copy with the extension BAK. BAS\ BAS refers to a source program written in the BASIC language. COB\ COB refers to a source program written in COBOL. HEX\ HEX refers to a special type file where all information has been stored in HEXADECIMAL format. Various applications software packages automatically add an extension. For example, ENABLE adds "WPF," DBASE adds "DBF, NDX, FRM, and MEM," LOTUS adds "WK1, PRN, and PIC." It is important to devise a naming scheme that is comfortable for you. Your command may have already addressed this area and come up with descriptive naming conventions. If so, of course, you will use those. Whatever method you use, be sure that it is indeed a method and NOT just haphazard naming of files. When working alongside the end users, be sure to pass along what you have learned. When they go to the filing cabinet, be sure they know exactly which file drawer to open and which file folder to retrieve from that drawer. Most people are familiar with organizing file folders in the drawers of a filing cabinet. You might want to use this analogy as a starting point, explaining to the users how they can organize their disk files in much the same manner. Explain how they can organize their work (files) into groups of files called directories. Directories File directories, like the folders that are filed away in drawers by category, or like the yellow pages of the phone book, provide you a way to organize and find files by category and name. Most operating systems give you the option of creating either single or multiple-file directories, regardless of whether your system uses floppy or hard disk. Disks with only one directory are said to be of the unstructured or flat type. Disks having more than one directory are said to be hierarchical or tree structured because they contain a root directory and several subdirectories, each subdirectory containing files with common subject matter. We use the term tree structure because this type of directory takes on the appearance of an upside down tree with the trunk of the tree or root directory located at the top and all the branches or subdirectories located below. Let's assume you have a floppy disk that contains 50 files with only a main or root directory, as shown in figure 2-16. Upon displaying the directory (using the DIRectory command), you notice the files are listed in random sequence, usually in the order of their creation or when last updated. We call this an unstructured directory. Looking more closely, you realize a number of things. First, that better organization is needed. Second, that most of the files listed can be grouped together by categories: supply, 3-M, personnel, disbursing, food services, and division management. Finally, you see that there are really two types of
Figure 2-16.\Unstructured disk file directory. categories: files that deal with user applications and those that deal strictly with division matters. Using the tree-structured approach, you can divide your disk into smaller units by subdirectories, as shown in figure 2-17. In this example, E5 Christmas, as the primary user of these files, decided to organize her files by setting up a separate directory called E5CHRISTMAS. Within the E5CHRISTMAS directory, she set up several subdirectories. They are identified by <DIR> following the name and they have no extensions. Notice also that some files, those that relate to division matters, are included in the subdirectory along with the subdirectories that relate to user files. Because E5 Christmas uses the division files frequently, she wanted to be able to access them directly from her directory. Subdirectories, like other files, appear as entries in the directory; however, you can't see a listing (or a display) of all the files in all the subdirectories at one
Figure 2-17.\Tree-structured disk file directory. time. Instead, you must look at each subdirectory to see what is in that one. If E5 Christmas wants to see what files are in the subdirectory SUPPLY, she would use the DOS command to change the directory name to SUPPLY and then display its directory (figure 2-18, example A). As the number of files on a disk increases, so does the need to have a disk that is well-organized. A well-organized disk can save you a considerable amount of time and frustration in locating files. As computer specialists, we know this is true and of great importance, but to the uninformed or new user who has not been properly trained, disk management may seem very cumbersome and time consuming. Some users may not even be aware that they can organize their files on disk, and that's where you come in. How can you help users create and use a tree-structured directory? you might ask. Whenever you format a disk, a single directory called a root directory is created. You can then instruct DOS to create or MaKe other DIRectories, using a command such as MKDIR or just plain MD. These are called subdirectories. Further, a subdirectory can have other subdirectories. Directories, regardless of their level, are given names just like any other files. DOS keeps track of each directory the same way it does your files. Using various DOS file handling commands, you can create (MKDIR or MD), change (CHDIR or CD), and remove (RMDIR or RD) directories and subdirectories. To move through the tree structure (UP or DOWN), you must issue commands that use a path name. A path name is a list of the directory(ies) (which might end with a file name) that DOS
Figure 2-18.\Examp1es of files in subdirectories. must follow to find a given directory/subdirectory or file name. In example B in figure 2-18, to locate the file named DIN-MENU.DLY, the path is \CHRISTMAS\FOODSERV\DIN-MENU.DLY. Once you have grouped related files into a subdirectory, you can act on them as a unit. The DOS file-handling commands can be applied to an entire subdirectory of files in a single stroke. For example, you can issue commands to copy, print, or delete all the files in a subdirectory as easily as you can for a single file. Other files on the same disk, but in different directories go unused and undisturbed. Subdirectories are especially helpful when working with hard disks because of their large storage capacities. To learn more about DOS directory structures and commands, read the DOS reference guide that accompanies the DOS software. |
||