/usr/lib/swipl/library/ext/clib/unix.pl
All Application Manual Name SummaryHelp

  • ext
    • clib
      • socket.pl
      • uid.pl -- User and group management on Unix systems
      • unix.pl -- Unix specific operations
        • fork/1
        • fork_exec/1
        • exec/1
        • wait/2
        • kill/2
        • pipe/2
        • dup/2
        • detach_IO/1
        • detach_IO/0
        • prctl/1
        • sysconf/1
      • syslog.pl
      • memfile.pl
      • time.pl -- Time and alarm library
      • uri.pl -- Process URIs
      • filesex.pl -- Extended operations on files
      • uuid.pl -- Universally Unique Identifier (UUID) Library
      • sha.pl -- SHA secure hashes
      • process.pl -- Create processes and redirect I/O
      • hash_stream.pl -- Maintain a hash on a stream
      • md5.pl -- MD5 hashes
      • rlimit.pl
      • mallocinfo.pl -- Memory allocation details
      • prolog_stream.pl -- A stream with Prolog callbacks
      • udp_broadcast.pl -- A UDP broadcast proxy
      • streaminfo.pl
      • crypt.pl
      • cgi.pl -- Read CGI parameters
      • streampool.pl -- Input multiplexing
 dup(+FromStream, +ToStream) is det
Interface to Unix dup2(), copying the underlying filedescriptor and thus making both streams point to the same underlying object. This is normally used together with fork/1 and pipe/2 to talk to an external program that is designed to communicate using standard I/O.

Both FromStream and ToStream either refer to a Prolog stream or an integer descriptor number to refer directly to OS descriptors. See also demo/pipe.pl in the source-distribution of this package.