• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

4.35 Operating System Interaction
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Operating System Interaction
          • shell/1
          • shell/2
          • getenv/2
          • setenv/2
          • unsetenv/1
          • setlocale/3
          • Windows-specific Operating System Interaction
          • Apple specific Operating System Interaction
          • Dealing with time and date
          • Controlling the swipl-win.exe console window
    • Packages
Availability:built-in
setenv(+Name, +Value)
Set an environment variable. Name and Value must be instantiated to atoms or integers. The environment variable will be passed to shell/[0-2] and can be requested using getenv/2. They also influence expand_file_name/2. Environment variables are shared between threads. Depending on the underlying C library, setenv/2 and unsetenv/1 may not be thread-safe and may cause memory leaks. Only changing the environment once and before starting threads is safe in all versions of SWI-Prolog.
ClioPatria (version V3.1.1-51-ga0b30a5)