[previous] [up] [next]     [index]
Next: Defining Data Classes and Up: Development through Iterative Refinement Previous: Development through Iterative Refinement

Data Analysis

When we turn a computer off, it should remember the functions and the data we worked on. Otherwise we have to reenter everything when we turn it on again. Things that a computer is to remember for a long time are put into files. A file is a sequence of small pieces of data. For our purposes, a file resembles a list; we ignore why and how a computer stores a file in a permanent manner.


picture18088

Figure: A sample directory tree


It is more important to us that, on most computer systems, the collection of files is organized in directories.[footnote] Roughly speaking, a directory contains some files and some more directories. The latter are called subdirectories and may contain yet more subdirectories and files, and so on. The entire collection is collectively called a file system or a directory tree. Figure [cross-reference] contains a graphical sketch of a small directory tree.[footnote] The tree's root directory is TS. It contains one file, called read!, and two subdirectories, called Text and Libs. The first subdirectory, Text, contains only three files; the latter, Libs, contains only two subdirectories, each of which contains at least one file. Each box has one of two annotations. A directory is annotated with DIR, and a file is annotated with a number, which signifies the file's size. Altogether TS contains seven files and consists of five (sub)directories.


Exercises Exercise 16.1.1

How many times does the file name read! occur in the directory tree TS? What is the total size of all the files in the tree? How deep is the tree (how many levels does it contain)? Solution




PLT