- swipl
- library
- error.pl
- debug.pl
- apply.pl
- lists.pl
- broadcast.pl
- shlib.pl
- option.pl
- thread_pool.pl
- gensym.pl
- settings.pl
- arithmetic.pl
- main.pl
- readutil.pl
- operators.pl
- pairs.pl
- prolog_source.pl
- quasi_quotations.pl
- url.pl
- www_browser.pl
- prolog_colour.pl
- record.pl
- prolog_xref.pl
- occurs.pl
- ordsets.pl
- assoc.pl
- ugraphs.pl
- solution_sequences.pl
- atom.pl
- prolog_pack.pl
- git.pl
- ctypes.pl
- utf8.pl
- base64.pl
- persistency.pl
- pure_input.pl
- nb_set.pl
- aggregate.pl
- csv.pl
- iostream.pl -- Utilities to deal with streams
- dialect.pl
- apply_macros.pl -- Goal expansion rules to avoid meta-calling
- yall.pl
- prolog_code.pl -- Utilities for reasoning about code
- dif.pl -- The dif/2 constraint
- thread.pl -- High level thread primitives
- predicate_options.pl
- rbtrees.pl
- nb_rbtrees.pl
- sandbox.pl
- prolog_format.pl
- random.pl
- pprint.pl
- modules.pl
- lazy_lists.pl
- edinburgh.pl
- prolog_clause.pl
- prolog_breakpoints.pl
- dicts.pl
- library
- open_any(+Specification, +Mode, -Stream, -Close, +Options)
- Establish a stream from Specification that should be closed
using Close, which can either be called or passed to
close_any/1. Options processed:
- encoding(Enc)
- Set stream to encoding Enc.
Without loaded plugins, the open_any/5 processes the following values for Specification. If no rule matches, open_any/5 processes Specification as
file(Specification).- Stream
- A plain stream handle. Possisible post-processing options such as encoding are applied. Close does not close the stream, but resets other side-effects such as the encoding.
- stream(Stream)
- Same as a plain Stream.
- FileURL
- If Specification is of the form =file://...=, the pointed to file is opened using open/4. Requires library(uri) to be installed.
- file(Path)
- Explicitly open the file Path. Path can be an Path(File) term as accepted by absolute_file_name/3.
- string(String)
- Open a Prolog string, atom, list of characters or codes as an input stream.
The typical usage scenario is given in the code below, where <process> processes the input.
setup_call_cleanup( open_any(Spec, read, In, Close, Options), <process>(In), Close).Currently, the following libraries extend this predicate:
- library(http/http_open)
- Adds support for URLs using the
httpandhttpsschemes.