Next: , Previous: , Up: The Prolog Library   [Contents][Index]


10.40 Operating System Utilities—library(system)

This package contains utilities for invoking services from the operating system that do not fit elsewhere. This package contains utilities for invoking services from the operating system that does not fit elsewhere.

Exported predicates:

now(-When)

Unifies the current date and time as a UNIX timestamp with When.

datime(-Datime)

Unifies Datime with the current date and time as a datime/6 record of the form datime(Year,Month,Day,Hour,Min,Sec). All fields are integers.

datime(+When,-Datime)
datime(-When,+Datime)

Convert a time stamp, as obtained by now/1, to a datime/6 record. Can be used in both directions.

sleep(+Seconds)

Puts the SICStus Prolog process asleep for Second seconds, where Seconds should be a non-negative number.

environ(?Var, ?Value)

Var is the name of a system property or an environment variable, and Value is its value. Both are atoms. Can be used to enumerate all current system properties and environment variables.

The same as environ(Var, Value, merged).

environ(?Var, ?Value, +Source)   since release 4.1

Var is the name of an environment variable or system property, and Value is its value. Both are atoms. Can be used to enumerate all current environment variables and system properties.

Source is one of properties, in which case only system properties are enumerated; environment, in which case only environment variables are enumerated; and merged, in which case both environment variables and system properties are enumerated. When Source is merged and an environment variable and a system property have equivalent names, the value of the system property is returned.

On UNIX-like platforms, two names are equivalent if and only if they are identical. On Windows-like platforms, a case insensitive comparison is used.

See System Properties and Environment Variables, for more information.



Send feedback on this subject.