- ext
- clib
- socket.pl -- Network socket (TCP and UDP) library
- uid.pl -- User and group management on Unix systems
- unix.pl -- Unix specific operations
- syslog.pl
- filesex.pl -- Extended operations on files
- uri.pl -- Process URIs
- process.pl -- Create processes and redirect I/O
- time.pl -- Time and alarm library
- sha.pl -- SHA secure hashes
- crypt.pl
- memfile.pl
- uuid.pl -- Universally Unique Identifier (UUID) Library
- hash_stream.pl -- Maintain a hash on a stream
- md5.pl -- MD5 hashes
- streampool.pl -- Input multiplexing
- cgi.pl -- Read CGI parameters
- prolog_stream.pl -- A stream with Prolog callbacks
- udp_broadcast.pl -- A UDP broadcast proxy
- rlimit.pl
- clib
- exec(+Command)
- Replace the running program by starting Command. Command is a
callable term. The functor is the command and the arguments
provide the command-line arguments for the command. Each
command-line argument must be atomic and is converted to a
string before passed to the Unix call
execvp()
. Here are some examples:exec(ls('-l'))
exec('/bin/ls'('-l', '/home/jan'))
Unix
exec()
is the only way to start an executable file executing. It is commonly used together with fork/1. For example to start netscape on an URL in the background, do:run_netscape(URL) :- ( fork(child), exec(netscape(URL)) ; true ).
Using this code, netscape remains part of the process-group of the invoking Prolog process and Prolog does not wait for netscape to terminate. The predicate wait/2 allows waiting for a child, while detach_IO/0 disconnects the child as a deamon process.