Did you know ... Search Documentation:
system.pl -- SICStus 3-compatible library(system).
PublicShow source
See also
- https://sicstus.sics.se/sicstus/docs/3.12.11/html/sicstus/System-Utilities.html
To be done
- This library is incomplete. As of SICStus 3.12.11, the following predicates are missing:
Source environ(?Name, ?Value) is nondet
True if Value is an atom associated with the environment variable or system property Name.
Compatibility
- sicstus
To be done
- Mode -Name is not supported.
Because SWI-Prolog doesn't have an obvious equivalent to
SICStus system properties, this predicate currently
behaves as if no system properties are defined,
i. e. only environment variables are returned.
Source exec(+Command, +Streams, -PID)
SICStus 3 compatible implementation of exec/3 on top of the SICStus 4 compatible process_create/3.
bug
- The SICStus version for Windows seems to hand Command directly to CreateProcess(). We hand it to
%COMSPEC% /s /c "Command"

In case of conflict, it is adviced to use process_create/3

Source wait(+PID, -Status)
Wait for processes created using exec/3.
See also
- exec/3
Source pid(-PID)
Process ID of the current process.
Compatibility
- sicstus.
Source now(-When) is det
Unify when with the current time-stamp
Compatibility
- sicstus
Source datime(+When, -Datime) is det
datime(-When, +Datime) is det
True when Datime is a datime/6 record that reflects the time stamp When.
Compatibility
- sicstus
Source datime(-Datime) is det
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.
Compatibility
- sicstus
Source system
Source system(+Command)
Source system(+Command, -Status)
Synomyms for shell/0, shell/1 and shell/2.
Compatibility
- sicstus.
Source popen(+Command, +Mode, ?Stream)
Compatibility
- sicstus
Source host_name(-HostName)
See also
- gethostname/1
Compatibility
- sicstus
Source mktemp(+Template, -File) is det
Interface to the Unix function. This emulation uses tmp_file/2 and ignores Template.
deprecated
- This interface is a security-risc. Use tmp_file_stream/3.
Compatibility
- sicstus
Source tmpnam(-FileName)
Interface to tmpnam(). This emulation uses tmp_file/2.
deprecated
- This interface is a security-risc. Use tmp_file_stream/3.
Compatibility
- sicstus
Source file_exists(+FileName) is semidet
True if a file named FileName exists.
Compatibility
- sicstus

Re-exported predicates

The following predicates are re-exported from other modules

Source shell
Execute an interactive shell. The following options are tried to find a suitable shell command:
  1. The Prolog flag shell
  2. The environment variable $SHELL
  3. The Prolog flag posix_shell
  4. The environment variable %comspec% (Windows only)
Errors
- existence_error(config, shell) if no suitable shell can be found.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 rename_file(Arg1, Arg2)
Source working_directory(Arg1, Arg2)
 delete_file(Arg1)
 sleep(Arg1)
 make_directory(Arg1)
Source system(Arg1)
Source shell(Arg1)
 shell(Arg1, Arg2)
Source system(Arg1, Arg2)