9Syntax14b.Scn.Fnt7ParcElemsAllocSyntax10.Scn.Fnt.Syntax10b.Scn.Fnt.x7M2ʭ7!d tO} Dir (HM June 96) Dir is a tool that allows the user to easily manipulate directories and files. It is similar to the Macintosh Finder or the Windows FileManager. The contents of a directory is shown in a viewer using one line for each entry (file or directory). A special icon (text element) at the beginning of a line indicates wether the entry is a file or a directory. The directory viewers are always kept up to date, i.e., if an entry is inserted, deleted or renamed by an Oberon program, this change is immediately reflected in the directory viewer(s). Opening a directory viewer The viewer of the current directory can be opened with Dir.Open. Any subdirectory in it can be opened with a middle-right click at the subdirectory icon. Directory viewers can be closed with System.Close. Renaming entries Simply edit the names in the directory viewer. As soon as the caret is removed from a modified line the corresponding entry is renamed. If the name is illegal the line is restored to its previous contents and the entry is not renamed. Deleting entries Select the icons of the entries to be deleted with the middle mouse button and invoke Dir.Delete from the Dir menu of the directory viewer. Note that directories can only be deleted if they are empty. Moving and copying entries between directories Open the viewers of the source and the destination directory. To move entries, select the entries in the source viewer with the middle mouse button and drag them to the destination viewer keeping the middle mouse button pressed. To copy entries, interclick the left mouse button while dragging the entries to the destination viewer. Directories can be moved but not copied (implementation restriction). Creating a new directory A new directory can be created with the command Dir.New which takes a path name as an argument. Examples of arguments: xxx If invoked from the menu of a directory viewer, xxx is created in this directory. If invoked from a tool text, xxx is created in the current working directory (which need not be the one displayed in the directory viewer). HD/Oberon/xxx Creates xxx as a subdirectory of HD/Oberon. xxx or ./xxx Creates xxx as a subdirectory of the current working directory. $xxx Creates xxx as a subdirectory of the directory that contains the Oberon application. Selecting and deselecting entries Entries can be selected individually by clicking the middle mouse button on their icons. Alternatively one can select all entries matching a certain pattern (e.g., *.Bak) with the command Dir.Select that takes the pattern as an argument. The pattern must be terminated by a " ", a TAB or an EOL. Entries can be deselected using the command Dir.Deselect. Opening files A middle-right click at a file icon will open the file using the command that was specified in Documents.Profile. Customizing (Dir.Menu.Text) The file Dir.Menu.Text contains a custom menu (usually a list of popup menus).