Operating system utilities

Author(s): Daniel Cabeza, Manuel Carro.

This module contains predicates for invoking services which are typically provided by the operating system. Note that the predicates which take names of files or directories as arguments in this module expect atoms, not path aliases. I.e., generally these predicates will not call absolute_file_name/2 on names of files or directories taken as arguments.

Documentation on exports

PREDICATE
time(Time)

Time is unified with the number of seconds elapsed since January, 1, 1970 (UTC).

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:int/1)Time is an integer.
  • The following properties hold upon exit:
    (basic_props:int/1)Time is an integer.

PREDICATE
datime(Datime)

Datime is unified with a term of the form datime(Year,Month,Day,Hour,Minute,Second) which contains the current date and time.

Usage:

  • Call and exit should be compatible with:
    (system:datime_struct/1)system:datime_struct(Datime)
  • The following properties should hold upon exit:
    (system:datime_struct/1)system:datime_struct(Datime)

PREDICATE
datime(Time,Year,Month,Day,Hour,Min,Sec,WeekDay,YearDay)

Time is as in time/1. WeekDay is the number of days since Sunday, in the range 0 to 6. YearDay is the number of days since January 1, in the range 0 to 365.

(Trust) Usage 1:

If Time is given, the rest of the arguments are unified with the date and time to which the Time argument refers.

  • Calls should, and exit will be compatible with:
    (basic_props:int/1)Year is an integer.
    (basic_props:int/1)Month is an integer.
    (basic_props:int/1)Day is an integer.
    (basic_props:int/1)Hour is an integer.
    (basic_props:int/1)Min is an integer.
    (basic_props:int/1)Sec is an integer.
    (basic_props:int/1)WeekDay is an integer.
    (basic_props:int/1)YearDay is an integer.
  • The following properties should hold at call time:
    (basic_props:int/1)Time is an integer.
  • The following properties hold upon exit:
    (basic_props:int/1)Year is an integer.
    (basic_props:int/1)Month is an integer.
    (basic_props:int/1)Day is an integer.
    (basic_props:int/1)Hour is an integer.
    (basic_props:int/1)Min is an integer.
    (basic_props:int/1)Sec is an integer.
    (basic_props:int/1)WeekDay is an integer.
    (basic_props:int/1)YearDay is an integer.

(Trust) Usage 2:

Bound Time, WeekDay and YearDay as determined by the input arguments.

  • Calls should, and exit will be compatible with:
    (basic_props:int/1)Time is an integer.
    (basic_props:int/1)WeekDay is an integer.
    (basic_props:int/1)YearDay is an integer.
  • The following properties should hold at call time:
    (basic_props:int/1)Year is an integer.
    (basic_props:int/1)Month is an integer.
    (basic_props:int/1)Day is an integer.
    (basic_props:int/1)Hour is an integer.
    (basic_props:int/1)Min is an integer.
    (basic_props:int/1)Sec is an integer.
  • The following properties hold upon exit:
    (basic_props:int/1)Time is an integer.
    (basic_props:int/1)WeekDay is an integer.
    (basic_props:int/1)YearDay is an integer.

(Trust) Usage 3:

Bound Time to current time and the rest of the arguments refer to current time.

  • Calls should, and exit will be compatible with:
    (basic_props:int/1)WeekDay is an integer.
    (basic_props:int/1)YearDay is an integer.
  • The following properties should hold at call time:
    (term_typing:var/1)Time is a free variable.
    (term_typing:var/1)Year is a free variable.
    (term_typing:var/1)Month is a free variable.
    (term_typing:var/1)Day is a free variable.
    (term_typing:var/1)Hour is a free variable.
    (term_typing:var/1)Min is a free variable.
    (term_typing:var/1)Sec is a free variable.
  • The following properties hold upon exit:
    (basic_props:int/1)Time is an integer.
    (basic_props:int/1)Year is an integer.
    (basic_props:int/1)Month is an integer.
    (basic_props:int/1)Day is an integer.
    (basic_props:int/1)Hour is an integer.
    (basic_props:int/1)Min is an integer.
    (basic_props:int/1)Sec is an integer.
    (basic_props:int/1)WeekDay is an integer.
    (basic_props:int/1)YearDay is an integer.

REGTYPE
A regular type, defined as follows:
datime_struct(datime(Year,Month,Day,Hour,Min,Sec)) :-
        int(Year),
        int(Month),
        int(Day),
        int(Hour),
        int(Min),
        int(Sec).

PREDICATE
getenvstr(Name,Value)

The environment variable Name has Value. Fails if variable Name is not defined.

Usage:

  • Call and exit should be compatible with:
    (basic_props:string/1)Value is a string (a list of character codes).
  • The following properties should hold at call time:
    (basic_props:atm/1)Name is an atom.
  • The following properties should hold upon exit:
    (basic_props:string/1)Value is a string (a list of character codes).

PREDICATE
setenvstr(Name,Value)

The environment variable Name is assigned Value.

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)Name is an atom.
    (basic_props:string/1)Value is a string (a list of character codes).

PREDICATE
current_env(Name,Value)

If Name is an atom, then unifies the environment variable Name with its value. Note that this predicate can be used to enumerate all the environment variables using backtracking.

Usage:

  • Call and exit should be compatible with:
    (basic_props:atm/1)Name is an atom.
    (basic_props:atm/1)Value is an atom.
  • The following properties should hold upon exit:
    (basic_props:atm/1)Name is an atom.
    (basic_props:atm/1)Value is an atom.

PREDICATE
set_env(Name,Value)

The environment variable Name is assigned Value.

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)Name is an atom.
    (basic_props:atm/1)Value is an atom.

PREDICATE
del_env(Name)

The environment variable Name is removed.

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)Name is an atom.

PREDICATE

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:int/1)Arg1 is an integer.
  • The following properties hold upon exit:
    (basic_props:int/1)Arg1 is an integer.

PREDICATE
copy_file(Source,Destination)

Copies the file Source to Destination.

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)Source is an atom.
    (basic_props:atm/1)Destination is an atom.

PREDICATE

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)Arg1 is an atom.
    (basic_props:atm/1)Arg2 is an atom.
    (system:copy_options/1)system:copy_options(Arg3)

PREDICATE
extract_paths(PathList,Paths)

Split PathList atom into the list of paths Paths. Paths in String are separated by the path list separator character (colons in POSIX-like systems, semicolons in Windows). Empty paths are removed from Paths. Paths is empty if PathList is the empty atom.

(True) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:list/2)Paths is a list of atms.
  • The following properties should hold at call time:
    (basic_props:atm/1)PathList is an atom.
  • The following properties hold upon exit:
    (basic_props:list/2)Paths is a list of atms.

PREDICATE

Usage:get_tmp_dir(TmpDir)

TmpDir is the (normalized) temporary directory for scratch space. On POSIX systems it is computed from normalizing the path specified in the TMPDIR environment variable. On Windows it is determined by the TMP or TEMP environment variable. If none is defined, this predicate tries to guess it from some usual locations (/tmp, /var/tmp, /usr/tmp on POSIX, c:\temp, c:\tmp, \temp, \tmp on Windows) or use . as last resort.

  • The following properties should hold at call time:
    (term_typing:var/1)TmpDir is a free variable.
  • The following properties should hold upon exit:
    (basic_props:atm/1)TmpDir is an atom.

PREDICATE
current_host(Hostname)

Hostname is unified with the fully qualified name of the host.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:atm/1)Hostname is an atom.
  • The following properties hold upon exit:
    (basic_props:atm/1)Hostname is an atom.

PREDICATE
current_executable(Path)

Unifies Path with the path to the current Ciao executable (which may be a standalone binary or bytecode executable)

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:atm/1)Path is an atom.
  • The following properties hold upon exit:
    (basic_props:atm/1)Path is an atom.

PREDICATE

(Trust) Usage 1:umask(OldMask,NewMask)

The process file creation mask was OldMask, and it is changed to NewMask.

  • The following properties should hold at call time:
    (basic_props:int/1)NewMask is an integer.
  • The following properties hold upon exit:
    (basic_props:int/1)OldMask is an integer.

(Trust) Usage 2:umask(OldMask,NewMask)

Gets the process file creation mask without changing it.

  • The following properties should hold at call time:
    (term_typing:var/1)OldMask is a free variable.
    (term_typing:var/1)NewMask is a free variable.
    (term_compare:== /2)The terms OldMask and NewMask are strictly identical.
  • The following properties hold upon exit:
    (basic_props:int/1)OldMask is an integer.
    (basic_props:int/1)NewMask is an integer.

PREDICATE
make_directory(DirName,Mode)

Creates the directory DirName with a given Mode. This is, as usual, operated against the current umask value.

(Trust) Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)DirName is an atom.
    (basic_props:int/1)Mode is an integer.

PREDICATE
make_directory(DirName)

Equivalent to make_directory(D,0o777).

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)DirName is an atom.

PREDICATE
working_directory(OldDir,NewDir)

Unifies current working directory with OldDir, and then changes the working directory to NewDir. Calling working_directory(Dir,Dir) simply unifies Dir with the current working directory without changing anything else.

(Trust) Usage 1:

Changes current working directory.

  • Calls should, and exit will be compatible with:
    (basic_props:atm/1)OldDir is an atom.
  • The following properties should hold at call time:
    (basic_props:atm/1)NewDir is an atom.
  • The following properties hold upon exit:
    (basic_props:atm/1)OldDir is an atom.

(Trust) Usage 2:working_directory(OldDir,NewDir)

Gets current working directory.

  • The following properties should hold at call time:
    (term_typing:var/1)OldDir is a free variable.
    (term_typing:var/1)NewDir is a free variable.
    (term_compare:== /2)The terms OldDir and NewDir are strictly identical.
  • The following properties hold upon exit:
    (basic_props:atm/1)OldDir is an atom.
    (basic_props:atm/1)NewDir is an atom.

PREDICATE
cd(Path)

Changes working directory to Path.

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)Path is an atom.

PREDICATE
directory_files(Directory,FileList)

FileList is the unordered list of entries (files, directories, etc.) in Directory.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:list/2)FileList is a list of atms.
  • The following properties should hold at call time:
    (basic_props:atm/1)Directory is an atom.
  • The following properties hold upon exit:
    (basic_props:list/2)FileList is a list of atms.

PREDICATE
mktemp(Template,Filename)

Returns a unique Filename based on Template: Template must be a valid file name with six trailing X, which are substituted to create a new file name. Filename is created in read/write mode but closed immediately after creation.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:atm/1)Filename is an atom.
  • The following properties should hold at call time:
    (basic_props:atm/1)Template is an atom.
  • The following properties hold upon exit:
    (basic_props:atm/1)Filename is an atom.

PREDICATE
No further documentation available for this predicate.

PREDICATE
file_exists(File)

Succeeds if File (a file or directory) exists (and is accessible).

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.

PREDICATE
file_exists(File,Mode)

File (a file or directory) exists and it is accessible with Mode, as in the Unix call access(2). Typically, Mode is 4 for read permission, 2 for write permission and 1 for execute permission.

(Trust) Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.
    (basic_props:int/1)Mode is an integer.
  • The following properties hold upon exit:
    (basic_props:atm/1)File is an atom.
    (basic_props:int/1)Mode is an integer.

PREDICATE
file_property(File,Property)

File has the property Property. The possible properties are:

type(Type)
Type is one of regular, directory, fifo, socket or unknown.

linkto(Linkto)
If File is a symbolic link, Linkto is the file pointed to by the link (and the other properties come from that file, not from the link itself).

mod_time(ModTime)
ModTime is the time of last modification (seconds since January, 1, 1970).

mode(Protection)
Protection is the protection mode.

size(Size)
Size is the size.

If Property is uninstantiated, the predicate will enumerate the properties on backtracking.

Usage:

  • Call and exit should be compatible with:
    (basic_props:struct/1)Property is a compound term.
  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.
  • The following properties should hold upon exit:
    (basic_props:struct/1)Property is a compound term.

PREDICATE
file_properties(Path,Type,Linkto,Time,Protection,Size)

The file Path has the following properties:

  • File type Type (one of regular, directory, fifo, socket or unknown).

  • If Path is a symbolic link, Linkto is the file pointed to. All other properties come from the file pointed, not the link. Linkto is ” if Path is not a symbolic link.

  • Time of last modification Time (seconds since January, 1, 1970).

  • Protection mode Protection.

  • Size in bytes Size.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:atm/1)Type is an atom.
    (basic_props:atm/1)Linkto is an atom.
    (basic_props:int/1)Time is an integer.
    (basic_props:int/1)Protection is an integer.
    (basic_props:int/1)Size is an integer.
  • The following properties should hold at call time:
    (basic_props:atm/1)Path is an atom.
  • The following properties hold upon exit:
    (basic_props:atm/1)Type is an atom.
    (basic_props:atm/1)Linkto is an atom.
    (basic_props:int/1)Time is an integer.
    (basic_props:int/1)Protection is an integer.
    (basic_props:int/1)Size is an integer.

PREDICATE
modif_time(File,Time)

The file File was last modified at Time, which is in seconds since January, 1, 1970. Fails if File does not exist.

Usage:

  • Call and exit should be compatible with:
    (basic_props:int/1)Time is an integer.
  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.
  • The following properties should hold upon exit:
    (basic_props:int/1)Time is an integer.

PREDICATE
modif_time0(File,Time)

If File exists, Time is its latest modification time, as in modif_time/2. Otherwise, if File does not exist, Time is zero.

Usage:

  • Call and exit should be compatible with:
    (basic_props:int/1)Time is an integer.
  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.
  • The following properties should hold upon exit:
    (basic_props:int/1)Time is an integer.

PREDICATE
touch(File)

Change the modification time of File to the current time of day. If the file does not exist, it is created with default permissions.

Note: This operation cannot be fully implemented with modif_time/2. In POSIX systems, that can be done as long as the user has write permissions on the file, even if the owner is different. Change of modification time to arbitrary time values is not allowed in this case.

Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.

PREDICATE
fmode(File,Mode)

The file File has protection mode Mode.

Usage:

  • Call and exit should be compatible with:
    (basic_props:int/1)Mode is an integer.
  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.
  • The following properties should hold upon exit:
    (basic_props:int/1)Mode is an integer.

PREDICATE
chmod(File,NewMode)

Change the protection mode of file File to NewMode.

(Trust) Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.
    (basic_props:int/1)NewMode is an integer.

PREDICATE
chmod(File,OldMode,NewMode)

The file File has protection mode OldMode and it is changed to NewMode.

Usage 1:

  • Call and exit should be compatible with:
    (basic_props:int/1)OldMode is an integer.
  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.
    (basic_props:int/1)NewMode is an integer.
  • The following properties should hold upon exit:
    (basic_props:int/1)OldMode is an integer.

Usage 2:chmod(File,OldMode,NewMode)

If OldMode is identical to NewMode then it is equivalent to fmode(File,OldMode)

  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.
    (term_typing:var/1)OldMode is a free variable.
    (term_typing:var/1)NewMode is a free variable.
  • The following properties should hold upon exit:
    (basic_props:atm/1)File is an atom.
    (basic_props:atm/1)OldMode is an atom.
    (basic_props:atm/1)NewMode is an atom.

PREDICATE
set_exec_mode(SourceName,ExecName)

Copies the permissions of SourceName to ExecName adding permissions to execute.

(True) Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)SourceName is an atom.
    (basic_props:atm/1)ExecName is an atom.

PREDICATE
delete_file(File)

Delete the file File.

(Trust) Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.

PREDICATE
delete_directory(File)

Delete the directory Directory.

(Trust) Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)File is an atom.

PREDICATE
rename_file(File1,File2)

Change the name of File1 to File2.

(Trust) Usage:

  • The following properties should hold at call time:
    (basic_props:atm/1)File1 is an atom.
    (basic_props:atm/1)File2 is an atom.

PREDICATE
pause(Seconds)

Make this thread sleep for some Seconds.

(Trust) Usage:

  • The following properties should hold at call time:
    (basic_props:int/1)Seconds is an integer.

PREDICATE

(Trust) Usage:wait(Pid,ReturnCode)

wait/2 waits for the process numbered Pid. Fails if the process does not terminate normally or in case of error (see C waitpid() for details). RetCode is the process return code.

  • The following properties should hold at call time:
    (term_typing:nonvar/1)Pid is currently a term which is not a free variable.
    (term_typing:var/1)ReturnCode is a free variable.
    (basic_props:int/1)Pid is an integer.
    (term_typing:var/1)ReturnCode is a free variable.
  • The following properties hold upon exit:
    (basic_props:int/1)ReturnCode is an integer.

PREDICATE

(Trust) Usage:kill(Pid,Signal)

kill/2 sends the signal Signal to the process or process group specified by Pid. See Unix man page for a detailed description of signals.

  • The following properties should hold at call time:
    (term_typing:nonvar/1)Pid is currently a term which is not a free variable.
    (term_typing:nonvar/1)Signal is currently a term which is not a free variable.
    (basic_props:int/1)Pid is an integer.
    (basic_props:int/1)Signal is an integer.

PREDICATE
get_pid(Pid)

Unifies Pid with the process identificator of the current process or thread.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:int/1)Pid is an integer.
  • The following properties hold upon exit:
    (basic_props:int/1)Pid is an integer.

PREDICATE
get_uid(Uid)

Unifies Uid with the user id of the current process.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:int/1)Uid is an integer.
  • The following properties hold upon exit:
    (basic_props:int/1)Uid is an integer.

PREDICATE
get_gid(Uid)

Unifies Gid with the group id of the current process.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:int/1)Uid is an integer.
  • The following properties hold upon exit:
    (basic_props:int/1)Uid is an integer.

PREDICATE
get_pwnam(User)

Unifies User with the user of the current process, as specified in the /etc/passwd file.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:atm/1)User is an atom.
  • The following properties hold upon exit:
    (basic_props:atm/1)User is an atom.

PREDICATE
get_grnam(Group)

Unifies Group with the group of the current process, as specified in the /etc/group file.

(Trust) Usage:

  • Calls should, and exit will be compatible with:
    (basic_props:atm/1)Group is an atom.
  • The following properties hold upon exit:
    (basic_props:atm/1)Group is an atom.

PREDICATE

(Trust) Usage:

Executes the OS-specific system shell. When the shell process terminates, control is returned to Prolog. See shell/2 for details.

    PREDICATE
    shell(Command)

    Command is executed in the OS-specific system shell. It succeeds if the exit code is zero and fails otherwise. See shell/2 for details.

    Usage:

    • The following properties should hold at call time:
      (basic_props:atm/1)Command is an atom.

    PREDICATE
    shell(Command,RetCode)

    Executes Command using the OS-specific system shell and stores the exit code in RetCode.

    On POSIX-like systems the system shell is specified by the SHELL environment variable ($SHELL -c "command" for passing user commands). On Windows (native builds, MinGW) it is specified by the COMSPEC environment variable (%COMSPEC% /s /c "command" for passing user commands).

    Note that the use of shell/2 predicates is discouraged for portability and security reasons. Please consider process for a more robust way to launch external processes.

    (Trust) Usage:

    • Calls should, and exit will be compatible with:
      (basic_props:int/1)RetCode is an integer.
    • The following properties should hold at call time:
      (basic_props:atm/1)Command is an atom.
    • The following properties hold upon exit:
      (basic_props:int/1)RetCode is an integer.

    PREDICATE
    system(Command)

    Like shell/1 but ignores exit code.

    Usage:

    • The following properties should hold at call time:
      (basic_props:atm/1)Command is an atom.

    PREDICATE
    system(Command,RetCode)

    Synonym for shell/2.

    (Trust) Usage:

    • Calls should, and exit will be compatible with:
      (basic_props:int/1)RetCode is an integer.
    • The following properties should hold at call time:
      (basic_props:atm/1)Command is an atom.
    • The following properties hold upon exit:
      (basic_props:int/1)RetCode is an integer.

    PREDICATE

    (True) Usage:

    Running in a Windows native environment (not emulating a POSIX system). On Cygwin platforms, this is currently detected by looking at the CIAOSCRIPT environment variable (which is added to the shell profile files during installation).

      PREDICATE

      Usage 1:winpath(A,B)

      • The following properties should hold at call time:
        (basic_props:atm/1)A is an atom.
        (term_typing:var/1)B is a free variable.
      • The following properties should hold upon exit:
        (basic_props:atm/1)A is an atom.
        (basic_props:atm/1)B is an atom.

      Usage 2:winpath(A,B)

      • The following properties should hold at call time:
        (term_typing:var/1)A is a free variable.
        (basic_props:atm/1)B is an atom.
      • The following properties should hold upon exit:
        (basic_props:atm/1)A is an atom.
        (basic_props:atm/1)B is an atom.

      Usage 3:winpath(A,B)

      • The following properties should hold at call time:
        (basic_props:atm/1)A is an atom.
        (basic_props:atm/1)B is an atom.
      • The following properties should hold upon exit:
        (basic_props:atm/1)A is an atom.
        (basic_props:atm/1)B is an atom.

      PREDICATE
      winpath(Option,Posix,WinPath)

      Option specifies if you want to get a relative or a full path. Posix represent a path as usual in unix, and WinPath is the Windows-Style representation of Posix.

      Usage 1:

      • The following properties should hold at call time:
        (term_typing:var/1)Option is a free variable.
        (term_typing:var/1)Posix is a free variable.
        (basic_props:atm/1)WinPath is an atom.
      • The following properties should hold upon exit:
        (system:winpath_option/1)system:winpath_option(Option)
        (basic_props:atm/1)Posix is an atom.

      Usage 2:

      • The following properties should hold at call time:
        (term_typing:var/1)Option is a free variable.
        (basic_props:atm/1)Posix is an atom.
        (term_typing:var/1)WinPath is a free variable.
      • The following properties should hold upon exit:
        (system:winpath_option/1)system:winpath_option(Option)
        (basic_props:atm/1)WinPath is an atom.

      PREDICATE
      Same as winpath/3, but for strings.

      PREDICATE

      Usage:cyg2win(CygWinPath,WindowsPath,SwapSlash)

      Converts a posix path to a Windows-style path. If SwapSlash is swap, slashes are converted in to backslash. If it is noswap, they are preserved.

      • The following properties should hold at call time:
        (basic_props:string/1)CygWinPath is a string (a list of character codes).
        (term_typing:var/1)WindowsPath is a free variable.
        (term_typing:atom/1)SwapSlash is currently instantiated to an atom.
      • The following properties should hold upon exit:
        (basic_props:string/1)CygWinPath is a string (a list of character codes).
        (basic_props:string/1)WindowsPath is a string (a list of character codes).
        (term_typing:atom/1)SwapSlash is currently instantiated to an atom.

      PREDICATE
      Same as cyg2win/3, but for atoms.

      PREDICATE
      No further documentation available for this predicate.

      PREDICATE
      replace_characters(String,SearchChar,ReplaceChar,Output)

      Replaces all the occurrences of SearchChar by ReplaceChar and unifies the result with Output

      PREDICATE

      Usage:system_error_report(Report)

      Report is the error message from the last system call, like strerror in POSIX.

      • The following properties should hold at call time:
        (term_typing:var/1)Report is a free variable.
      • The following properties should hold upon exit:
        (basic_props:atm/1)Report is an atom.

      PREDICATE

      Usage:get_home(H)

      H is the home directory (HOME environment variable in POSIX systems and APPDATA in Windows)

      • The following properties should hold at call time:
        (term_typing:var/1)H is a free variable.

      PREDICATE

      Usage:find_executable(Name,Path)

      Path is the absolute path of the command Name, reachable from the PATH (environment variable) directories if Name is not an absolute path. The suffix for executable files is optionally added to Path depending on the current operating system.

      • The following properties should hold at call time:
        (term_typing:nonvar/1)Name is currently a term which is not a free variable.
        (term_typing:var/1)Path is a free variable.

      Documentation on multifiles

      PREDICATE

      (Trust) Usage:define_flag(Flag,FlagValues,Default)

      • The following properties hold upon exit:
        (basic_props:atm/1)Flag is an atom.
        (basic_props:flag_values/1)Define the valid flag values
      The predicate is multifile.

      Known bugs and planned improvements

      • Run-time checks have been reported not to work with this code. That means that either the assertions here, or the code that implements the run-time checks are erroneous.
      • We use atoms to represent file names. This pollutes the atom table. We need atom garbage collection and/or native strings.
      • In some situations, copy_file don't work when the second argument is a directory, example:

        copy_file( 'site/ciaopp_online.html' , ~distdir, yes),