Liking cljdoc? Tell your friends :D

clojure.java.process

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.

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.
raw docstring

execclj

(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.

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.
sourceraw docstring

exit-refclj

(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.

Given a Process (the output of 'start'), return a reference that can be
used to wait for process completion then returns the exit value.
sourceraw docstring

from-fileclj

(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.

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.
sourceraw docstring

startclj

(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.

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.
sourceraw docstring

stderrclj

(stderr process)

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

Given a process, return the stderr of the external process (an InputStream)
sourceraw docstring

stdinclj

(stdin process)

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

Given a process, return the stdin of the external process (an OutputStream)
sourceraw docstring

stdoutclj

(stdout process)

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

Given a process, return the stdout of the external process (an InputStream)
sourceraw docstring

to-fileclj

(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.

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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close