GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • API Index
  • clojure.core
  • clojure.data
  • clojure.datafy
  • clojure.edn
  • clojure.inspector
  • clojure.instant
  • clojure.java.basis
  • clojure.java.browse
  • clojure.java.io
  • clojure.java.javadoc
  • clojure.java.process
  • clojure.java.shell

This view

  • Original page
  • New address

GeezerVison is showing clojure.github.io — clojure.java.process - Clojure v1.12.4 API documentation

Clojure

Clojure Core API Reference

Clojure v1.12.4 API
  • Overview
  • API Index
Namespaces
  • clojure.core
  • clojure.data
  • clojure.datafy
  • clojure.edn
  • clojure.inspector
  • clojure.instant
  • clojure.java.basis
  • clojure.java.browse
  • clojure.java.io
  • clojure.java.javadoc
  • clojure.java.process
  • clojure.java.shell
  • clojure.main
  • clojure.math
  • clojure.pprint
  • clojure.reflect
  • clojure.repl
  • clojure.set
  • clojure.stacktrace
  • clojure.string
  • clojure.template
  • clojure.test
  • clojure.tools.deps.interop
  • clojure.walk
  • clojure.xml
  • clojure.zip
Other Versions
  • v1.12.3 (stable)
  • v1.13 (in development)
  • v1.11.4 (legacy)
  • v1.10.3 (legacy)
  • v1.9 (legacy)
  • v1.8 (legacy)
  • v1.7 (legacy)
  • v1.6 (legacy)
  • v1.5 (legacy)
  • v1.4 (legacy)
  • v1.3 (legacy)
  • v1.2 (legacy)
  • v1.1 (legacy)
Clojure Home

Table of Contents

Overview
Vars and Functions
exec
exit-ref
from-file
start
stderr
stdin
stdout
to-file

API for clojure.java.process - Clojure v1.12.4 (stable)


Full namespace name: clojure.java.process

Overview

A process invocation API wrapping the Java process API.

The primary function is 'start' which starts a process and handles the
streams as directed. It returns the Process object. Use 'exit-ref' to wait
for completion and receive the exit value, and ‘stdout', 'stderr', 'stdin'
to access the process streams. The 'exec' function handles the common case
to 'start' a process, wait for process exit, and return stdout.

Public Variables and Functions



exec

function
Usage: (exec & opts+args)
Execute a command and on successful exit, return the captured output,
else throw RuntimeException. Args are the same as 'start' and options
if supplied override the default 'exec' settings.

    Added in Clojure version 1.12
Source


exit-ref

function
Usage: (exit-ref process)
Given a Process (the output of 'start'), return a reference that can be
used to wait for process completion then returns the exit value.

    Added in Clojure version 1.12
Source


from-file

function
Usage: (from-file f)
Coerce f to a file per clojure.java.io/file and return a ProcessBuilder.Redirect reading from the file.
This can be passed to 'start' in :in.

    Added in Clojure version 1.12
Source


start

function
Usage: (start & opts+args)
Start an external command, defined in args.
The process environment vars are inherited from the parent by
default (use :clear-env to clear them).

If needed, provide options in map as first arg:
  :in - a ProcessBuilder.Redirect (default = :pipe) or :inherit
  :out - a ProcessBuilder.Redirect (default = :pipe) or :inherit :discard
  :err - a ProcessBuilder.Redirect (default = :pipe) or :inherit :discard :stdout
  :dir - current directory when the process runs (default=".")
  :clear-env - if true, remove all inherited parent env vars
  :env - {env-var value} of environment variables to set (all strings)

Returns the java.lang.Process.

    Added in Clojure version 1.12
Source


stderr

function
Usage: (stderr process)
Given a process, return the stderr of the external process (an InputStream)

    Added in Clojure version 1.12
Source


stdin

function
Usage: (stdin process)
Given a process, return the stdin of the external process (an OutputStream)

    Added in Clojure version 1.12
Source


stdout

function
Usage: (stdout process)
Given a process, return the stdout of the external process (an InputStream)

    Added in Clojure version 1.12
Source


to-file

function
Usage: (to-file f & {:keys [append], :as opts})
Coerce f to a file per clojure.java.io/file and return a ProcessBuilder.Redirect writing to the file.
Set ':append' in opts to append. This can be passed to 'start' in :out or :err.

    Added in Clojure version 1.12
Source
Copyright 2007-2025 by Rich Hickey
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.