14.7 System Information and Control
function | |
See rhombus/version for version-number conversion and comparison utilities.
> system.version()
"0.45"
function | |
See rhombus/version for version-number conversion and comparison utilities.
"9.1"
function | |
function | |
function | |
|
function | |
function | |
| |
annotation | |
The system.TargetMachineSymbol annotation is satisfied by a machine type symbol that are supported as a compilation target by the host Racket system, which may include a cross-compilation target machine.
function | |
function | |
function | |
On Unix and Mac OS, the string is five characters: two lowercase ASCII letters for the language, an underscore, and two uppercase ASCII letters for the country. On Windows, the string can be arbitrarily long, but the language and country are in English (all ASCII letters or spaces) separated by an underscore.
On Unix, the result is determined by checking the LC_ALL, LC_TYPE, and LANG environment variables, in that order (and the result is used if the environment variable’s value starts with two lowercase ASCII letters, an underscore, and two uppercase ASCII letters, followed by either nothing or a period). On Windows and Mac OS, the result is determined by system calls.
function | |
| |
function | |
See also measure.cpu_milliseconds and measure.real_milliseconds.
function | ||||||||||||||
| ||||||||||||||
| ||||||||||||||
enumeration | ||||||||||||||
|
#'home_dir: The current user’s home directory.
On all platforms, if the PLTUSERHOME environment variable is defined as an absolute path, then the path is used as the user’s home directory.
On Unix and Mac OS, when PLTUSERHOME does not apply, the user’s home directory is determined by expanding the path "~", which is expanded by first checking for a HOME environment variable. If none is defined, the USER and LOGNAME environment variables are consulted (in that order) to find a user name, and then system files are consulted to locate the user’s home directory.
On Windows, when PLTUSERHOME does not apply, the user’s home directory is the user-specific profile directory as determined by the Windows registry. If the registry cannot provide a directory for some reason, the value of the USERPROFILE environment variable is used instead, as long as it refers to a directory that exists. If USERPROFILE also fails, the directory is the one specified by the HOMEDRIVE and HOMEPATH environment variables. If those environment variables are not defined, or if the indicated directory still does not exist, the directory containing the current executable is used as the home directory.
#'pref_dir: The platform-standard directory for storing the current user’s preferences. The preferences directory might not exist.
On Unix, the preferences directory is normally the "racket" subdirectory of the path specified by the XDG_CONFIG_HOME environment variable, or it is ".config/racket" in the user’s home directory if XDG_CONFIG_HOME is not set to an absolute path or if PLTUSERHOME is set. Either way, if that directory does not exist but a ".racket" directory exists in the user’s home directory, then that directory is the preference directory, instead.
On Windows, the preferences directory is "Racket" in the user’s home directory if determined by PLTUSERHOME, otherwise in the user’s application-data folder as specified by the Windows registry; the application-data folder is usually "Application Data" in the user’s profile directory.
On Mac OS, the preferences directory is "Library/Preferences" in the user’s home directory.
#'pref_file: A Racket-format file that contains a symbol-keyed association list of preference values. The file’s directory path always matches the result returned for #'pref_dir. The file name is "racket-prefs.rktd" on Unix and Windows, and it is "org.racket-lang.prefs.rktd" on Mac OS. The file’s directory might not exist.
#'temp_dir: The platform-standard directory for storing temporary files. On Unix and Mac OS, this is the directory specified by the TMPDIR environment variable, if it is defined, otherwise it is the first path that exists among "/var/tmp", "/usr/tmp", and "/tmp". On Windows, the result is the directory specified by the TMP or TEMP environment variable, if it is defined, otherwise it is the current directory.
#'addon_dir: A directory for user-specific Racket configuration, packages, and extension. This directory is specified by the PLTADDONDIR environment variable, and it can be overridden by the --addon or -a command-line flag to Racket. If no environment variable or flag is specified, or if the value is not a legal path name, then this directory defaults to a platform-specific locations. The directory might not exist.
On Unix, the default is normally the "racket" subdirectory of the path specified by XDG_DATA_HOME, or ".local/share/racket" in the user’s home directory if XDG_CONFIG_HOME is not set to an absolute path or if PLTUSERHOME is set. If that directory does not exists but a ".racket" directory exists in the user’s home directory, that the ".racket" directory path is the default, instead.
On Windows, the default is the same as the #'pref_dir directory.
On Mac OS, the default is "Library/Racket" within the user’s home directory.
#'host_addon_dir: Like #'addon_dir, but when cross-platform build mode has been selected, the result refers to a directory for the current system’s installation, instead of for the target system.
#'cache_dir: A directory for storing user-specific caches. The directory might not exist.
On Unix, the cache directory is normally the "racket" subdirectory of the path specified by XDG_CACHE_HOME, or ".cache/racket" in the user’s home directory if XDG_CACHE_HOME is not set to an absolute path or if PLTUSERHOME is set. If that directory does not exist but a ".racket" directory exists in the home directory, then the ".racket" directory is the cache directory, instead.
On Windows, the cache directory is the same as the result returned for #'addon_dir.
On Mac OS, the cache directory is "Library/Caches/Racket" within the user’s home directory.
#'doc_dir: The platform-standard directory for storing the current user’s documents. On Unix, it’s the user’s home directory. On Windows, it is the user’s home directory if determined by PLTUSERHOME, otherwise it is the user’s documents folder as specified by the Windows registry; the documents folder is usually "My Documents" in the user’s home directory. On Mac OS, it’s the "Documents" directory in the user’s home directory.
#'desk_dir: The platform-standard directory for the current user’s desktop. On Unix, it’s the user’s home directory. On Windows, it is the user’s home directory if determined by PLTUSERHOME, otherwise it is the user’s desktop folder as specified by the Windows registry; the desktop folder is usually "Desktop" in the user’s home directory. On Mac OS, it is "Desktop" in the user’s home directory.
#'sys_dir: The directory containing the operating system for Windows. On Unix and Mac OS, the result is Path("/").
#'exec_file: The path of the Racket executable as provided by the operating system for the current invocation. For some operating systems, the path can be relative.
#'run_file: The path of the current executable; this may be different from result for #'exec_file because an alternate path was provided through a --name or -N command-line flag to the Racket executable, or because an embedding executable installed an alternate path.
#'orig_dir: The current directory at start-up, which can be useful in converting a relative-path result from system.path(#'exec_file) or system.path(#'run_file) to a complete path.