The issue of undeleting a file was a pretty important one: In the original versions
of DOS, it was very easy to make a mistake typing a command or entering a file-
name and erasing your only copy of the Great American Novel. Poof: gone!
And defragmentation, if left untreated, can become a serious problem on a
computer, causing the operating system (or Windows) and programs and
files to open slower and slower and s-l-o-w-e-r to the point where the machine
is almost unusable. I explain the not-all-that-complex concept of fragmenta-
tion and undeleting in the “Cracking fragmentation” sidebar.
A secondary value of defragmentation (and sometimes a primary one) is that
contiguous files are easier to recover in case of corruption to the file attribute
table — the index of filenames and locations maintained by the operating
system. Data recovery programs can find the single file without having to look
for its broken pieces.
290 Part V: The Software Side of Life
Cracking fragmentation
What is fragmentation? Start by considering the
fact that not every file is the same length. You
may write a short note to yourself, and the com-
puter will store it in a space of, say, 64 KB of
space. (The actual minimum size for a file
depends on the size of the disk, the operating
system, and the file management system used
to format the drive.) The next file you store might
be a digitized photo or a song that occupies
3MB (a space 50 times larger than your note).
What happens if you later reopen that short
note and add a few more pages to it? One pos-
sibility is that the note will be split into two
pieces and placed wherever there is a hole.
Another possibility is that first small file will be
“deleted” and a longer, single file will be placed
somewhere else on the disk.
So that brings me to “deleting” a file. You might
think this means the file is physically erased from
the surface of the drive, but to do so would waste
a relatively huge amount of time. Remember that
computers are all about speed. Instead of eras-
ing the file, the hard drive controller changes
the first letter of the filename to a nonstandard
character (such as an %; actually, it uses the
hexadecimal value E5) that the file indexing
system doesn’t recognize. The file is still there,
but the index no longer sees it.
And so the two solutions: A defragmenter
searches the drive for all of the file or program
pieces and then locates an open space to
recopy the pieces into a contiguous stream of
digital information. The first defraggers did
simply that, but later versions used more sophis-
ticated programming to place more commonly
used files in locations where the read/write
heads can more quickly find them.
And the first “undelete” program was basically
as simple as this: It searched the hard drive for
files that began with hexadecimal E5 and then
presented a list of those files. When you found
the one you wanted to save, you instructed the
program to change that nonstandard character
to one that would make the entire file visible to
the operating system. (From such a relatively
simple utility was born the substantial fortune of
Peter Norton, a good-hearted friend of mine
from the early days of the PC.)