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 of the namespace where ⎕SYSTEM was called (# or ⎕SE) and contains only namespace members. Each sub-namespace contains only variable members.

Information

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

Warning

Do attempt to add or modify members as changes will not be persisted. Instead, clone the namespace using ⎕NS ⎕SYSTEM and modify the result, but 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.

Hints and Recommendations

This can be changed using the ]CD user command, but doing so after tying component files or native files or associating external functions can lead to data loss.

Directories.Initial

The directory from which Dyalog was started.

Directories.Temp

The operating system's recommended location for temporary files.

Information

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; 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.

Hints and Recommendations

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.

Hints and Recommendations

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.

Hints and Recommendations

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

  • .NET/.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.

Information

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.

Hints and Recommendations

Whether (1) or not (0) PCRE2 is in use is given by 10≤⎕SYSTEM.Features.PCRE.

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

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

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.Newline

Numeric vector of Unicode code points for the operating system's newline sequence – either (10 ⋄) or 13 10.

Hints and Recommendations

This 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 local time zone is offset from UTC.

Hints and Recommendations

A positive number means the local time zone is ahead of UTC. A negative number means behind UTC. For example, if ⎕OS.UTCOffset is 10, then when it is noon UTC (12:00), it is 10 PM local time (12+10, that is, 22:00).

OS.Version

A three-element integer vector:

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

Warning

Windows 11 identifies itself as "Windows 10". Whether (1) or not (0) Windows 10 is in use is given by 1 0 1≡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