20 Welcome, New User!
Automatic file versioning, which gives new versions of files new
names or numbered extensions, would preserve previous versions
of files. This would prevent new versions of files from overwriting
old versions. Overwriting happens all the time in Unix.
- Unix programmers have a criminally lax attitude toward error
reporting and checking.
Many programs don’t bother to see if all of the bytes in their output
file can be written to disk. Some don’t even bother to see if their
output file has been created. Nevertheless, these programs are sure
to delete their input files when they are finished. - The Unix shell, not its clients, expands “”.
Having the shell expand “” prevents the client program, such as
rm, from doing a sanity check to prevent murder and mayhem.
Even DOS verifies potentially dangerous commands such as
“del .”. Under Unix, however, the file deletion program cannot
determine whether the user typed:
% rm *
or:
% rm file1 file2 file3 ...
This situation could be alleviated somewhat if the original com-
mand line was somehow saved and passed on to the invoked client
command. Perhaps it could be stuffed into one of those handy envi-
ronment variables.
- File deletion is forever.
Unix has no “undelete” command. With other, safer operating sys-
tems, deleting a file marks the blocks used by that file as “available
for use” and moves the directory entry for that file into a special
directory of “deleted files.” If the disk fills up, the space taken by
deleted files is reclaimed.
Most operating systems use the two-step, delete-and-purge idea to
return the disk blocks used by files to the operating system. This
isn’t rocket science; even the Macintosh, back in 1984, separated
“throwing things into the trash” from “emptying the trash.” Tenex
had it back in 1974.