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

  • ext
    • clib
      • socket.pl -- Network socket (TCP and UDP) library
      • uid.pl
      • unix.pl -- Unix specific operations
      • syslog.pl -- Unix syslog interface
      • 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
      • prolog_server.pl
      • udp_broadcast.pl -- A UDP broadcast proxy
      • crypt.pl
      • streaminfo.pl
        • stream_info/1
      • streampool.pl -- Input multiplexing
      • cgi.pl -- Read CGI parameters
 stream_info(+Stream) is det
Print detailed information about a stream or a file-number to the error output. The output of this command is meant for experts and requires knowledge about the implementation of streams. It has been added to diagnose leaking streams in web-servers. For example, on linux systems we can examine process file-descriptors using
% ls -l /proc/<pid>/fd

If now (say) descriptor 15 is open where it should not be, we can this command to find the associated Prolog streams and print as mush as possible information about the stream.

?- stream_info(15).
Arguments:
Stream- A stream-handle, alias name, (integer) system file handle or '<stream>(address)' atom.