Previous: Core attribute functions, Up: Core API Reference


2.4 System information

To use the functions described in this section, you will need to load the (geda os) module.

This section describes some functions and variables that are useful for Scheme code that needs to behave differently depending on which operating system gEDA is running on.

— Variable: separator-char

The directory separator character that should be used on the host platform.

— Variable: separator

A string containing separator-char.

— Variable: path-separator-char

The character used for separating the elements in ‘PATH’-like environment variables on the host platform.

— Variable: path-separator

A string containing path-separator-char.

— Function: platform

Returns a list of symbols describing the host platform. The returned symbols may include:

— Function: platform? type

Returns ‘#t’ if the platform description list returned by platform contains the symbol type, and ‘#f’ otherwise.

— Function: sys-data-dirs

Returns an ordered list of directories in which to access system-wide gEDA data.

— Function: sys-config-dirs

Returns an ordered list of directories in which to access system-wide gEDA configuration information.

— Function: user-data-dir

Returns the directory in which to store user-specific gEDA data.

— Function: user-config-dir

Returns the directory in which to store user-specific gEDA configuration information.

— Function: expand-env-variables str

Recursively expands str until no more environment variables can be expanded, and return the expanded string. Environment variables are in the form ‘${VAR}’.

          (expand-env-variables "${HOME}/path/to/dir")