Skip to content

System Information R←⎕SYSTEM

This function returns a namespace providing information about the current Dyalog interpreter and the host environment.

Syntax

⎕SYSTEM is niladic.

Examples

Reporting the current directory:

      ⎕SYSTEM.Directories.Current
C:\Program Files\Dyalog\Dyalog APL-64 21.0 Unicode
Finding the operating system's preferred directory separator:
      ⎕SYSTEM.OS.DirectorySeparator
\
Getting the currently running APL interpreter's version number:
      ⎕SYSTEM.Executable.VersionNumber
21

The result R is a namespace in the root (# or ⎕SE) of the current namespace. R contains only namespace members, each of which only contains variable members.

More members might be added in a future release of Dyalog, but R will remain serialisable using 1∘⎕JSON.

Warning

Do not attempt to add or modify members (changes will not be persisted); only modify clones of the namespace (⎕NS ⎕SYSTEM). Note that this locks down dynamic values like ⎕SYSTEM.Directories.Current and ⎕SYSTEM.OS.UTCOffset.

Members of the Result

CommandLine

This namespace provides information about the command line expression used to start the interpreter.

CommandLine.Args

The command line used to start the current executable, split on unquoted space sequences into a vector of character vectors.

CommandLine.CodeArgs

This member is intended to ease usage of APL shell scripts. It is equivalent to CommandLink.Args but omits everything up to and including -script. If Dyalog is started without -script then nothing is omitted.

CommandLine.Full

The full command line used to start the current executable as a simple character vector.

Directories

This namespace provides pertinent locations in the file system.

Directories.Current

The current working directory.

Directories.Initial

The directory from which Dyalog was started.

Directories.Temp

The operating system's recommended location for temporary files.

This location is for an individual user and can be cleaned up without warning, so use it only as a place to put files that will immediately be used and will not be needed later.

It is good practice to delete such files when no longer needed.

Executable

This namespace provides information about the specific interpreter instance in which ⎕SYSTEM was called.

Executable.Bits

Indicates whether the interpreter is a 64- or 32-bit application.

Warning

Do not confuse this with the bit width of the operating system; some 64-bit operating systems can run 32-bit interpreters (but not the other way round).

Executable.BuildTarget

For Dyalog internal use only.

Executable.BuildType

For Dyalog internal use only.

Executable.Path

The full file path to the interpreter's executable file.

Executable.RideConnected

Boolean indicating whether (1) or not (0) there is an active connection using the RIDE protocol.

Executable.Runtime

Boolean indicating whether (1) or not (0) this is a runtime interpreter.

Executable.Unicode

Boolean indicating whether (1) or not (0) the interpreter can represent characters outside ⎕AV.

Executable.Vendor

The originator of the interpreter, that is, 'Dyalog'.

Executable.Version

The interpreter's full version number as three integers indicating the major release, minor release, and build number. For example, 21 0 53977

Executable.VersionMoniker

A six-character shorthand for the Version's first two elements together with Unicode and Bits, for example 210U64.

This is particularly useful to find out where the Session Initialisation looks for a StartupSession directory on Unix, namely in 'dyalog.',Executable.VersionMoniker,'.files' inside the user's home directory ($HOME).

Executable.VersionNumber

The version number as a single number, for example, 21.3.

This is useful for comparing version numbers to deal with varying feature sets. For example:

:If 22≤Executable.VersionNumber
    source←⎕APLAN array
:Else
    source←⎕SE.Dyalog.Array.Serialise array
:EndIf

Features

This namespace provides information about optional or versioned functionality inside the interpreter.

Features.DDE

Boolean indicating whether (1) or not (0) Dynamic Data Exchange is available.

Features.DotNet

Full version number of the available .NET (possibly .NET Framework) as three integers indicating the major release, minor release, and build number, for example, 4 8 9325. If no .NET is available, this is 0 0 0.

Related indications whether (1) or not (0):

  • .NET or .NET Framework is available: 0≠⊃⎕SYSTEM.Features.DotNet
  • .NET Framework is in use: 4=⊃⎕SYSTEM.Features.DotNet
  • .NET (non-Framework) is in use: 5≤⊃⎕SYSTEM.Features.DotNet

Features.Interactive

Boolean indicating whether (1) or not (0) an interactive session is available.

Examples of non-interactive interpreters include the runtime and shell script interpreters.

Features.OLE

Boolean indicating whether (1) or not (0) Object Linking and Embedding is available.

Features.PCRE

Full version of the built-in Perl Compatible Regular Expressions engine, for example 10 47.

Host

This namespace provides information about network identity.

Host.ComputerName

The name of the machine, which is the hostname under Unix and the NetBIOS name under Microsoft Windows.

Host.DNSDomainName

The Domain Name System domain of the machine.

Host.EffectiveUserId

The Effective User Identifier is a non-negative integer on Unix and ¯1 on Microsoft Windows.

Host.EffectiveUserName

The character vector name associated with the current Effective User Identifier on Unix and '' on Microsoft Windows.

Host.FQDN

The fully qualified domain name of the current machine as a character vector.

Host.GroupId

A character vector which on Microsoft Windows is the Security Identifier (with the relative identifier section removed) and on Unix is the Group identifier.

Host.GroupName

The character vector group identifier on Unix and '' on Microsoft Windows.

Host.NetBIOSDomainName

The character vector NetBIOS domain name on Microsoft Windows and '' on Unix.

Host.UserId

On Microsoft Windows, this is the relative identifier. On Unix, the identifier of the currently logged-in user. Note that this is always a character vector, even on Unix where the value looks like a number.

Host.UserName

The currently logged-in user.

OS

This namespace provides information about the operating system.

OS.Bits

Indicates whether a 64- or 32-bit architecture.

Warning

This is not necessarily the same as the bit width of the executable system; 64-bit operating systems can run 32-bit interpreters (but not the other way round).

OS.Description

The operating system's self-description ("pretty name"). For example, Debian GNU/Linux 13 (trixie) or Microsoft Windows 11 Pro.

Dyalog on AIX

This is slow on AIX because the operating system takes a significant amount of time to deliver its description.

OS.DirectorySeparator

The preferred separator character used in file paths – either '/' or '\'.

OS.Family

Either 'Windows' or 'Unix'.

OS.LibcPath

The character vector location of the C standard library on Unix and '' on Microsoft Windows.

OS.Name

One of 'Windows', 'macOS', 'AIX', or 'Linux'.

OS.Newline

Numeric vector of Unicode code points for the operating system's newline sequence – either (10 ⋄) or 13 10. It can be converted to a character vector with ⎕UCS ⎕SYSTEM.OS.Newline.

OS.NullDevice

The filename associated with the null device.

OS.PathSeparator

The character used to separate multiple filenames in a single character vector. This is ';' on Microsoft Windows and ':' on Unix.

OS.SharedLibraryExtension

The preferred file extension for shared libraries – one of '.dll' (Microsoft Windows), '.dylib' (macOS), or '.so' (Linux).

OS.UTCOffset

The number of hours by which the current local time zone (with daylight saving time taken into account) is offset from UTC.

For example, if the local time is 07:00 while UTC is 10:00, then ⎕OS.UTCOffset is ¯3.

OS.Version

A three-element integer vector:

  • Microsoft Windows: major and minor version and build number
  • Linux or macOS: major, minor, and patch version
  • AIX: version and release number, followed by a 0

Warning

Microsoft has made both Windows 10 and Windows 11 report their version as "10", but ⎕SYSTEM.OS.Description includes the number "11" on Windows 11.

The following expression will determine whether a reported version 10 is truly 10: ((10=⊃)∧22000>⊢/)⎕SYSTEM.OS.Version.

OS.VolumeSeparator

The character used to separate the volume from the rest of a file path – one of '/' or ':'.

Process

This namespace provides information about the interpreter's operating system process.

Process.Id

Non-negative integer process identifier (PID) of the interpreter.

Process.LaunchTarget

The fully qualified path of the file or directory loaded at startup. This is set by either a workspace name on the APL command line or using the LOAD configuration parameter.

Process.ParentId

Non-negative integer process identifier of the process that launched the interpreter. Always ¯1 on Microsoft Windows.

⎕SYSTEM SYSTEM