Syntax10.Scn.FntZParcElemsAllocSyntax20.Scn.Fnt.Syntax12.Scn.FntZSyntax12b.Scn.Fnt Z ZStyleElemsAllocu FirstIndent2Z&Syntax12i.Scn.Fnt S/'9 t-v`(J"TableElemsAllocSyntax12.Scn.FntQSyntax12i.Scn.Fnt.(%*/noheads "*" /columns LLL /table full path /c:/Oberon/User/Configuration.Mod (* Windows *) /Romeo/Oberon/User/Configuration.Mod (* Mac *) filename only Configuration.Mod (* sought in all paths *) startup directory /c:/Oberon (* Windows *) /Romeo/Oberon (* Mac *) current directory /c:/Oberon/User (* Windows *) /Romeo/Oberon/User (* Mac *) parent of current .. relative to current ./Configuration.Mod relative to parent ../User/Configuration.Mod relative to startup $User/Configuration.Mod )*B Zu FirstIndent1  Zu FirstIndent2t Zu FirstIndent1 N , , `: B Z  Zu FirstIndent1 G > A C " ", Z  Text20 Zu FirstIndent1  Text2 Zu FirstIndent1\ Z  Zu FirstIndent1\ Z  Text2 Z  Zu FirstIndent1 M A Guide to Oberon with Paths and Directories C. Steindl, August 1997  Introduction  Oberon usually supports only a flat directory where all files (*.Mod, *.Obj, *.Tool, *.Text, *.Bak, *.Sym) reside. But you can also arrange your data in directories or in folders. With this version of Oberon it is possible to: 1) Define paths (directories, folders) in which files are automatically sought, when they shall be opened. 2) Change the current working directory. In the following we will use the term path, directory or folder synonymously. Each denoting a place on a hard disk where files can be stored. The current working directory is the directory where all files are stored. Specification of files and directories You can specify files and directories with pathnames. A full pathname is a volume specification followed by a sequence of directory names, separated by a special delimiter character (as defined in Directories.delimiter), starting from the root directory (or volume) and leading down to the file. A relative pathname is relative to the current working directory or to the startup directory. The startup directory is the current working directory after startup (containing the Oberon executable). The following grammar describes how files and directories are specified (it conforms to the format of URLs): Item = [AbsoluteLocation | RelativeLocation] (File | Directory). AbsoluteLocation = "/" Volume { "/" Directory} "/". RelativeLocation = RelativeDirectory "/" [Directory { "/" Directory} "/"]. Volume = MacVolume | WindowsVolume. MacVolume = name. WindowsVolume = char ":". Directory = name | RelativeDirectory. RelativeDirectory = ".." (* parent directory *) | "." (* current directory *) | "$". (* startup directory, contains Oberon executable *) File = name. Examples:  Startup process under Oberon for Windows Under Windows, Oberon is started by clicking on an icon. Associated with this icon is the information where the application is located and which directory shall be the working directory. When loaded, Oberon looks for a file called "Oberon.Ini" in the following directories: (1) current directory, (2) Windows system directory, (3) Windows directory, (4) in all directories listed in the PATH environment variable. You can also specify the file to be used for initialization with the option -i (e.g. -i c:\Oberon\User\Oberon.ini). This initialization file contains some initial settings including a path variable which denotes a sequence of paths that shall be sought when looking for a file (similar to the DOS environment variable PATH). Startup process under Oberon for PowerMac On a PowerMac, Oberon is started by clicking on the application. If there is a file called "Paths.Text" in the same directory as the application, then the sequence of paths in the the file "Paths.Text" will be sought when looking for a file. The startup directory is the directory that contains the Oberon application. Opening files Unless you specify a pathname, files are sought 1) in the current working directory 2) in the defined search paths 3) in the startup directory Storing files Unless you specify a pathname, new files (including new versions of existing files) are stored in the current working directory. Commands in module System Directory (^ | pattern["\"{"d" | "a" | "s" | "n" | "D" | "A" | "S" | "N"}]) lists the directory entries that match the specified pattern. The following options are possible: "d" or "D" for date "s" or "S" for size "a" or "A" for looking in all paths ChangeDir (^ | name) changes the current working directory to the specified directory. CreateDir (^ | name) creates the specified directory. DeleteDir (^ | name) deletes the specified directory. ParentDir changes the current working directory to the parent directory of the current working directory. ShowDir displays the current working directory in the log viewer. StartupDir changes the current working directory to the startup directory. Module Directories Exported procedures Current () returns a directory structure denoting the current working directory. Startup () returns a directory structure denoting the startup directory. This (path) returns a directory structure denoting the specified directory. Change (path) changes the current working directory to the specified directory. Create (path) creates the specified directory. Delete (path) deletes the specified directory. Rename (oldPath, newPath) renames the directory oldPath to newPath. Enumerate (dir, fileProc) calls fileProc for each entry in the specified directory. The type FileProc is defined as PROCEDURE (d: Directory; name: ARRAY OF CHAR; isDir: BOOLEAN; VAR continue: BOOLEAN). isDir is TRUE if the directory entry specified by name is itself a directory. If the called procedure sets the parameter continue to FALSE, the enumeration process is ended immediately. EnumeratePaths (pathProc) calls pathProc for each search path. The type PathProc is defined as PROCEDURE (path: ARRAY OF CHAR; VAR continue: BOOLEAN); If the called procedure sets the parameter continue to FALSE, the enumeration process is ended immediately. LocalToURL (name) and URLToLocal (name) convert the name into URL format and local format (Windows and Mac specific) respectively. Exported variables: res indicates the result of the last directory operation and can be any of the exported values (noErr, badName, mediumFull, mediumLocked, dirInUse, notADir, alreadyExists, and otherError) notify is a procedure variable which is called whenever a directory entry is inserted or deleted. The type Notifier is defined as PROCEDURE (op: INTEGER; path, name: ARRAY OF CHAR); op can be one of the exported values (insert or delete). path and name specify the inserted/deleted directory entry. Exported constants: delimiter is the special character that delimits directory names within a path ("/").