22 lines
1.1 KiB
Plaintext
22 lines
1.1 KiB
Plaintext
In order to properly restore directories, with their appropriate
|
|
access modes, owner, etc, each directory is archived by
|
|
writing only the file header block. The archived directory
|
|
size (contents) is set to 0 bytes.
|
|
|
|
The method used to determine which directories need to be
|
|
archived is to build a directory tree in dynamically allocated
|
|
memory, from the command line arguments. Note that the
|
|
tree may also have explicitly named non-directory files.
|
|
Then, this tree is walked starting at the root node, archiving
|
|
each non-directory file as encountered, and recursively archiving
|
|
each directory file as encountered. If a directory file is
|
|
also a leaf of the tree, then all files which are children
|
|
of that node also become candidates for archiving.
|
|
|
|
This method may require a large amount of dynamic memory, particularly
|
|
if the list of files to archive is read from the standard input.
|
|
This restriction is expected to become less of a problem in the
|
|
future, with the emergence of virtual memory and processors with
|
|
large address spaces. Anyone who designs a new UNIX machine with anything
|
|
else is foolish.
|