Syntax14b.Scn.Fnt7ParcElemsAllocSyntax10.Scn.Fnt/Syntax10b.Scn.Fnt.O!d | Dir (HM Sept. 95) 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. Creating a new directory A new directory can be created with the command Dir.New which takes a path name as an argument. The path name can be specified either as a full path (e.g., HD:Oberon:User:NewDir), as a partial path starting from the current directory (e.g., :NewDir), or as a partial path starting from the directory that contains the Oberon application (e.g., $User:NewDir). If a directory with this path already exists, nothing is created. 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 Dir.Menu.Text (see below). Customizing (Dir.Menu.Text) The file Dir.Menu.Text contains a custom menu as its first line (usually a list of popup menus). Subsequent lines specify the commands that should be used for opening files. These lines have the following syntax: Openers = {Pattern Command}. Pattern = string. -- e.g. "*.Tool" Command = name | string. -- e.g. System.Open Files for which there is no pattern are opened with Edit.Open.