The File System: 4.1 Directories and Paths: Standard Paths

Up: GEOS SDK TechDocs | Up | Prev: 4 Directories and Paths | Next: 4.2 Current Path and Directory Stack

The GEOS system is designed to run on a wide variety of architectures. For example, it can be stored on a hard disk, recorded in ROM chips, or resident on a network server and run by members of the network. This presents a difficulty. The system uses many files, storing both code (such as libraries) and data (such as fonts). It can't assume that they are in any specific place. For example, a user might be running GEOS from a network server, but she might have several fonts for personal use on her own hard disk. The system has to be able to look in all the right places. Applications have a similar dilemma. An application needs to be able to choose an appropriate place to create data files, and needs to be able to find them later.

The solution to this is to use standard paths . There are a number of standard directories GEOS uses. Each one of these has a constant associated with it. The constants are treated as special disk handles. For example, the routine FileSetCurrentPath() (described in Current Path and Directory Stack ) takes two arguments, a disk handle and a path string. If the disk handle passed is the constant SP_DOCUMENT and the string passed is "Memos", the routine will look in the standard document path for a directory called "Memos" and will open it.

There are two advantages to standard paths. The first is that they give the system and the applications points of reference. An application does not need to worry where to write its internal data files; it can simply install them in the standard PRIVDATA directory.

The second advantage is that the standard paths do not need to correspond to any one specific directory. A standard path can actually be several different DOS directories. For example, the GEOS kernel looks for font files in the standard path SP_FONT. The user may define this path to be several directories; it might comprise a local directory for the most commonly used fonts, a network directory for some decorative fonts, etc. The file system would automatically locate all of these fonts. Similarly, the SP_DOCUMENT directory might comprise a directory on a ROM disk for read-only files, as well as a directory on a hard disk where files are written. A standard path is considered "read-only" if and only if all of the directories which make up the standard path are read-only. When you create a file directly in a standard path (as opposed to in a subdirectory of a standard path), the file system will write it to the directory on the disk containing the geos.ini file.

The standard paths have a default hierarchy. For example, the standard path SP_VIDEO_DRIVERS usually refers to a directory named VIDEO which belongs to the standard path SP_SYSTEM. However, the user is allowed to define each standard path however he or she wishes. For this reason, the programmer may not make any assumptions about where each standard path is located.

Below is a list of standard paths currently implemented. The paths are described as if they were single directories; remember, however, that each one of these may comprise several directories. Each path is accompanied by notes on how it is used and where it might commonly be found. The user can decide where each of these directories is, so make no assumptions about their locations. These paths will always be supported; future versions of GEOS may add new paths.

SP_TOP
The top level directory. This is the directory which contains GEOS.INI. This is often C:\GEOWORKS.
SP_APPLICATION
All non-system applications are in this directory or a directory belonging to it. This is often a WORLD directory under SP_TOP.
SP_DOCUMENT
All document files should go here. This is commonly a DOCUMENT directory under SP_TOP.
SP_SYSTEM
All libraries and drivers belong to this directory. All libraries must go in this directory, not in a subdirectory. Drivers are further grouped into subdirectories, one for each type of driver. This is commonly a SYSTEM directory under SP_TOP. Geodes should never need to directly access this directory, other than for installing drivers to it.
SP_PRIVATE_DATA
This contains data files which should not be accessed by users. By convention, each geode creates a subdirectory with its own data files. For example, the application HELLO.GEO would use a directory called HELLO in SP_PRIVATE_DATA. This is commonly a PRIVDATA directory under SP_TOP.
SP_DOS_ROOM
This directory contains the DOS-room launchers. It is commonly a DOSROOM directory under SP_TOP.
SP_STATE
This directory contains all state files. It is commonly a STATE directory under PRIVDATA.
SP_USER_DATA
This directory holds data files that the user may add to, delete, upgrade, or otherwise change. Each data file type should have its own subdirectory. This is commonly a USERDATA directory under SP_TOP.
SP_FONT
This directory contains all font data files, no matter what format they are. It is often USERDATA\FONT.
SP_SPOOL
This directory contains all application spooler files. It is commonly USERDATA\SPOOL.
SP_SYS_APPLICATION
This directory contains all system applications. For example, it contains the Geoworks Pro "Welcome" application. These applications should not be launched by the user from the desktop. This directory is commonly SYSTEM\SYSAPPL.
SP_MOUSE_DRIVERS
This directory contains all mouse drivers. It is commonly SYSTEM\MOUSE.
SP_PRINTER_DRIVERS
This contains all printer drivers. It is commonly SYSTEM\PRINTER.
SP_FILE_SYSTEM_DRIVERS
This directory contains drivers for file systems. It has both DOS and network drivers. It is commonly SYSTEM\FS.
SP_VIDEO_DRIVERS
This directory contains video drivers. It is commonly SYSTEM\VIDEO.
SP_SWAP_DRIVERS
This directory has all of the swap drivers. It is commonly SYSTEM\SWAP.
SP_KEYBOARD_DRIVERS
This directory has all of the keyboard drivers. It is commonly SYSTEM\KEYBOARD.
SP_FONT_DRIVERS
This directory has all of the font drivers. It is commonly SYSTEM\FONT.
SP_IMPORT_EXPORT_DRIVERS
This directory has all of the import/export libraries. It is commonly SYSTEM\IMPEX.
SP_TASK_SWITCH_DRIVERS
This directory contains all task-switching drivers. It is commonly SYSTEM\TASK.
SP_HELP_FILES
This directory contains all help files. It is commonly USERDATA\HELP.
SP_TEMPLATE
This directory contains document templates. It is commonly DOCUMENT\TEMPLATE.
SP_POWER_DRIVERS
This directory contains power-management drivers. It is commonly SYSTEM\POWER.
SP_HWR
This directory contains the handwriting recognition libraries. It is commonly SYSTEM\HWR.
SP_WASTE_BASKET
This directory contains files that have been dragged to the waste basket but have not yet been thrown out. All non-open files and directories in this path are periodically deleted. Temporary files should usually be created here; they will not be deleted until after they have been closed. This directory is commonly PRIVDATA\WASTE.
SP_BACKUP
This directory contains backup files made by the document control. It is commonly \PRIVDATA\BACKUP.

Up: GEOS SDK TechDocs | Up | Prev: 4 Directories and Paths | Next: 4.2 Current Path and Directory Stack