CASE HISTORY # 6 by the Disk Doctor -------------------------------------------- Copyright (C) 1987, the Disk Doctor. First published in the Rochester (PC)^3 News: Picture City PC Programming Club PO BOX 20342 Rochester, NY 14602 The Disk Doctor may be contacted at this address, or via CIS [73147,414]. This material may be reproduced for internal use by other not-for-profit groups, provided this copyright notice is included. ---------------------------------------------- 9:25am "Doc, it's good to see you again. Thanks for coming over." I had stopped by the Purchasing department to help my friend, TW, with a problem. "Remember how we used to have that shoebox full of diskettes?" TW pointed to the empty cardboard container in the waste basket. "Well, we finally took your recommendation and bought ourselves a hard-card. It came in just yesterday. Amazing little bugger. Imagine, 10 MegaBytes in a single slot." "Did you have a problem installing it?" "No. Installation was a cinch. I just popped it in to an empty slot. No, the problem showed up after I began to copy our files over to drive C:. All of a sudden it won't take anymore." "You mean the disk is full?" "I don't think so. When I do a DIR, it says 8.9 MB free. The error message is something about 'file creation error'." "You'd better show me what you've got." 9:30am I verified the problem for myself. It was just as he said. Next, I did a TREE command to list all his directories. "Oh boy. You've got all these programs in the root directory!" "Huh? What do you mean, rude erectomy?" "No, R-O-O-T directory. It's the root of the directory hierarchy." TW looked at me with a smirk. "I don't understand any of this stuff, but I'm glad you got to the 'root' of the problem." I shook my head. I try to ignore bad puns (unless they're my own). "Here, take a seat while I explain directories to you. 9:37am "The hard disk can hold millions of files, more files that anyone can easily keep track of. So, the operating system provides the ability to group related files into separate sub-directories." "Why did they have to make this more complicated than it already was?" "For a couple reasons. When you do a DIRectory command, and there are 100 files, what do you do?" "I use one of those DIR tricks you showed me, either DIR/W to show the files wide across the screen, or else DIR/P so it pauses every 22 files." "Right. Think what it would be like to find one file in a list 5,000 files long." "Geez. It would take all day." "Exactly. That's why DOS provides sub- directories, to group files in logical subsets. When you use DOS commands like DIR or COPY, they work on only one sub- directory at a time. DOS remembers the current directory, just as it remembers the default disk drive." 9:39am I continued. "These directories are set up in a hierarchical arrangement like a tree. At the top of the tree is the root directory." "Boy somebody got that backwards." "Maybe so, but we're stuck with that terminology. On a 10 MB hard disk, the root directory is allocated a fixed 32 sectors. That limits us to no more than 512 files in the root directory. So what we have to do now is to copy all your files into different sub-directories." "You mean each directory is limited to 512 files?" "No, only the root directory has that restriction. The root directory has to occupy a certain place on the disk, and its size is fixed. But sub-directories are just like files. They can be created anywhere on the disk, and may be any length." "You said DOS only works in one directory at a time, right?" "Right." "Does that mean I have to make copies of those DOS programs I use all the time, like CHKDSK, FORMAT, and so on?" "No. That's where the DOS PATH facility comes in. Your PATH-link lets DOS find executable programs or batch files in another directory. Most people set up one master DOS directory. Here let me show you. Use the MKDIR command to create directories... 10:15am "There," I said as he copied the last file into the newly created directory structure. "Now you should be all set." "Wait a minute, Doc. You've been such a big help this morning, I'm going to create one more directory, in your honor." He typed in MD \HICKORY. "I don't understand. That's not my name. What does the 'hickory' stand for?" "Come now. Surely you've heard of HICKORY Directory, Doc!"