next up previous
Next: File System Interaction Up: Built-In Predicates Previous: Terminal Control

Unix Interaction

shell( +Command, -Status)

  Execute Command on the operating system. Command is given to the bourne shell (/bin/sh). Status is unified with the exit status of the command.
shell( +Command)

  Equivalent to `shell(Command, 0) '.
shell

  Start an interactive Unix shell. Default is /bin/sh , the environment variable SHELL overrides this default.
getenv( +Name, -Value)

  Get Unix environment variable (see csh(1) and sh(1)). Fails if the variable does not exist.
setenv( +Name, +Value)

  Set Unix environment variable. Name and Value should be instantiated to atoms or integers. The environment variable will be passed to shell/[0-2] and can be requested using getenv/2.
unsetenv( +Name)

  Remove Unix environment variable from the environment.
get_time( -Time)

  Return the number of seconds that elapsed since the epoch of Unix, 1 January 1970, 0 hours. Time is a floating point number. Its granularity is system dependant. On SUN, this is 1/60 of a second.
convert_time( +Time, -Year, -Month, -Day, -Hour, -Minute, -Second, -MilliSeconds)

  Convert a time stamp, provided by get_time/1, file_time/2, etc. Year is unified with the year, Month with the month number (January is 1), Day with the day of the month (starting with 1), Hour with the hour of the day (0--23), Minute with the minute (0--59). Second with the second (0--59) and MilliSecond with the milli seconds (0--999). Note that the latter might not be acurate or might always be 0, depending on the timing capabilities of the system.



Passani Luca
Tue Nov 14 08:58:33 MET 1995