Disc Tree Cataloguer
by Andrew Cumming

Tree displays a directory tree in a graphical form. It provides a useful method of viewing the contents of a whole disc or of more than one directory at once. This is a similar idea to the tree shown by the 'File Manager' in Windows 3.0 on the PC.

Running the application installs an icon on the icon bar. Clicking on the icon bar icon or choosing the 'Read tree' entry from the icon bar menu reads the contents of the disc in the default ADFS drive (or SCSI/IDE drive if one is present) and opens a window displaying the tree.

You can specify a particular drive, or the RAM filing system, or provide a path of your own for the root of the tree, using the 'Read tree' submenu. Clicking on the ADFS, SCSI or IDE menu entries without selecting a drive from their submenus results in the default drive for that filing system being used. Any path you supply should be a full pathname of a directory, e.g. 'ADFS::Fred.$.Utils', and may involve any filing system. Once the tree window has been opened, it can be closed in the normal way and then opened again in the same place by clicking on the icon bar icon. To read another tree, use the 'Read tree' menu entry.

You can control whether or not files, applications and application contents are displayed using the 'View' dialogue box, accessed from the tree window menu (click Menu over the main tree display window). This box also allows you to provide a wildcarded name with which displayed applications or files must match, allowing a simple search to be carried out. A list of filetypes that should be displayed can also be provided: note that this should be a comma separated list and that either filetype names or numbers in hex can be entered, e.g. 'FFF' or 'Text'.

The objects displayed in the window behave in a similar way to those displayed in the Filer windows, i.e. double-clicking on a directory opens a Filer window for that directory, double-clicking on a file or application runs the object, and double-clicking on an application while holding down Shift opens a Filer window showing the contents of the application directory. Using Adjust for any of these options also closes the tree window.

Clicking on an object selects it, the currently selected object being shown in red. The 'Select' submenu can then be used to either 'Open' a Filerwindow if the object is a directory or application, or 'Run' the object if it is a file or application. Clicking on the currently selected object with Adjust deselects that object. Clicking on the window background at the top and bottom of the window also deselects the current object (that is, if you select a non-existent object).

To open a Filer window for the root directory, choose the 'Open root' entry from the tree window menu.

NOTE: to catalogue a whole hard disc can take a minute or so, so do not panic if the computer seems to be taking a long time.

Expanding and collapsing branches
---------------------------------
At first, only the first level of the tree is shown, i.e. the contents of the root directory. Selecting 'Expand all' from the 'Tree' submenu expands all of the branches, and allows all of the objects on the disc to be seen. Conversely, 'Close all' closes all of the branches, taking you back to the first level only.

The Tree submenu also allows you to expand individual branches, i.e. expand the currently selected directory or application, and to close them again using the 'Expand branch' and 'Close branch' options. 'Expand next level' shows only the next level of that particular branch, i.e. it does not expand any subdirectories.

A branch can also be expanded by double-clicking on it with the Alt key held down; double-clicking with Ctrl closes the branch again. To expand only the next level of a directory, double-click with Shift (this is not applicable to an application since this opens the Filer window for the application directory).

Note that the objects that are displayed are controlled by the 'View' dialogue box. For example, expanding a branch which contains only files will have no visible effect if the 'Files' icon is deselected in the 'View' dialogue box; similarly, you cannot see the result of expanding an application branch if the 'Application Contents' icon in the 'View' box is deselected. (However, the branches are still expanded internally, and if the View options are changed in an appropriate way later, the contents of the branch will then be visible.)

The Options dialogue box
------------------------
This allows you to set various effects and customise the tree display.

Open selected directory:
These options result in a Filer window being opened.

Expand selected branch:
Makes the object selected expand automatically. (On deselecting that object or selecting another the Filer window is automatically closed again. The selected branch is only closed on deselect.)

Save settings on exit:
Saves the settings on quitting the program. The settings include the options selected in the Options and View dialogue boxes. The settings can be saved at any time by using the 'Save settings' option on the icon bar menu.

Expand all on entry:
This automatically expands all branches on reading a tree.

Update
------
To update the directory tree (for example, if files have been added or removed from the disc using the Filer, making the tree shown inaccurate), select the Update option from the tree window menu.

Miscellaneous notes
-------------------
When entering your own pathname it is preferable to use the disc name, for example 'ADFS::Fred.$' rather than 'ADFS::0.$', for two reasons, both quite minor ones. Firstly, use of the name means that if the correct disc is not in the drive on selecting the Update menu entry, it will be asked for. Not using the name will result in either the incorrect tree being read if the root directory path is applicable to the disc in the drive, or in an error.

Also, if you open a Filer directory display using Tree, it will have a title made up from your path, e.g. 'ADFS::0.$'. Opening the same display using the Filer alone would use a path with the disc name, and this could result in two directory windows being open for the same directory, one with the title 'ADFS::0.$', the other with the title 'ADFS::Fred.$'.

Only the second of these applies to hard drives.

The C source code for this application has been saved as !Tree.C_Source.

 RISC User 1992
