-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathclojure.java.process-api.html
More file actions
253 lines (220 loc) · 14.2 KB
/
Copy pathclojure.java.process-api.html
File metadata and controls
253 lines (220 loc) · 14.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>clojure.java.process - Clojure v1.12.4 API documentation</title>
<link rel="icon" href="static/favicon.png" />
<link rel="shortcut icon" href="static/favicon.png" />
<link rel="stylesheet" href="static/clojure.css" type="text/css" media="all" />
<link rel="stylesheet" href="static/wiki.css" type="text/css" media="all" />
<link rel="stylesheet" href="static/internal.css" type="text/css" media="all" />
<style>.menuWrapper{height: 36px;}</style>
</head>
<!--
This document was auto-generated from the source by the clojure autodoc system.
To report errors or ask questions about the overall documentation structure, formatting,
etc., contact Tom Faulhaber (google mail name: tomfaulhaber).
For errors in the documentation of a particular namespace, contact the author of that
namespace.
-->
<body>
<div id="AllContentContainer">
<div id="Header">
<a href="index.html" id="Logo"><img src="static/clojure-icon.gif" width="100" height="100" alt="Clojure" /></a>
<h1><a href="index.html" id="page-header" title="page header title">Clojure Core API Reference</a></h1>
</div>
<div id="leftcolumn"><div style="text-align: center;"></div>
<div class="menu">
<div class="WikiCustomNav WikiElement wiki">
<span class="toc-header"><span id="project-name">Clojure</span> <span id="version">v1.12.4</span> API</span><br />
<ul>
<li><a href="index.html" class="wiki_link">Overview</a></li>
<li><a href="api-index.html" class="wiki_link">API Index</a></li>
</ul>
<div class="NamespaceTOC">
<span class="toc-header">Namespaces</span>
<ul id="left-sidebar-list">
<li><a class="wiki_link" href="clojure.core-api.html">clojure.core</a></li><li><a class="wiki_link" href="clojure.data-api.html">clojure.data</a></li><li><a class="wiki_link" href="clojure.datafy-api.html">clojure.datafy</a></li><li><a class="wiki_link" href="clojure.edn-api.html">clojure.edn</a></li><li><a class="wiki_link" href="clojure.inspector-api.html">clojure.inspector</a></li><li><a class="wiki_link" href="clojure.instant-api.html">clojure.instant</a></li><li><a class="wiki_link" href="clojure.java.basis-api.html">clojure.java.basis</a></li><li><a class="wiki_link" href="clojure.java.browse-api.html">clojure.java.browse</a></li><li><a class="wiki_link" href="clojure.java.io-api.html">clojure.java.io</a></li><li><a class="wiki_link" href="clojure.java.javadoc-api.html">clojure.java.javadoc</a></li><li><a class="wiki_link" href="clojure.java.process-api.html">clojure.java.process</a></li><li><a class="wiki_link" href="clojure.java.shell-api.html">clojure.java.shell</a></li><li><a class="wiki_link" href="clojure.main-api.html">clojure.main</a></li><li><a class="wiki_link" href="clojure.math-api.html">clojure.math</a></li><li><a class="wiki_link" href="clojure.pprint-api.html">clojure.pprint</a></li><li><a class="wiki_link" href="clojure.reflect-api.html">clojure.reflect</a></li><li><a class="wiki_link" href="clojure.repl-api.html">clojure.repl</a></li><li><a class="wiki_link" href="clojure.set-api.html">clojure.set</a></li><li><a class="wiki_link" href="clojure.stacktrace-api.html">clojure.stacktrace</a></li><li><a class="wiki_link" href="clojure.string-api.html">clojure.string</a></li><li><a class="wiki_link" href="clojure.template-api.html">clojure.template</a></li><li><a class="wiki_link" href="clojure.test-api.html">clojure.test</a></li><li><a class="wiki_link" href="clojure.tools.deps.interop-api.html">clojure.tools.deps.interop</a></li><li><a class="wiki_link" href="clojure.walk-api.html">clojure.walk</a></li><li><a class="wiki_link" href="clojure.xml-api.html">clojure.xml</a></li><li><a class="wiki_link" href="clojure.zip-api.html">clojure.zip</a></li>
</ul>
</div>
<div class="BranchTOC">
<span class="toc-header">Other Versions</span>
<ul id="left-sidebar-branch-list">
<li><a class="wiki_link" href="index.html">v1.12.3 (stable)</a></li><li><a class="wiki_link" href="branch-master/index.html">v1.13 (in development)</a></li><li><a class="wiki_link" href="branch-clojure-1.11.4/index.html">v1.11.4 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.10.3/index.html">v1.10.3 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.9.0/index.html">v1.9 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.8.0/index.html">v1.8 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.7.0/index.html">v1.7 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.6.0/index.html">v1.6 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.5.0/index.html">v1.5 (legacy)</a></li><li><a class="wiki_link" href="branch-clojure-1.4.0/index.html">v1.4 (legacy)</a></li><li><a class="wiki_link" href="branch-1.3.x/index.html">v1.3 (legacy)</a></li><li><a class="wiki_link" href="branch-1.2.x/index.html">v1.2 (legacy)</a></li><li><a class="wiki_link" href="branch-1.1.x/index.html">v1.1 (legacy)</a></li>
</ul>
</div>
<a class="wiki_link" href="https://clojure.org">Clojure Home</a>
</div>
</div>
</div>
<div id="rightcolumn">
<div id="Content">
<div class="contentBox"><div class="innerContentBox">
<div class="wiki wikiPage" id="content_view">
<div id="right-sidebar"><div id="toc">
<h1 class="nopad">Table of Contents</h1>
<div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#toc0">Overview</a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#var-section">Vars and Functions</a>
<div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.java.process/exec" class="toc-entry-anchor">exec</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.java.process/exit-ref" class="toc-entry-anchor">exit-ref</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.java.process/from-file" class="toc-entry-anchor">from-file</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.java.process/start" class="toc-entry-anchor">start</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.java.process/stderr" class="toc-entry-anchor">stderr</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.java.process/stdin" class="toc-entry-anchor">stdin</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.java.process/stdout" class="toc-entry-anchor">stdout</a>
</div><div class="toc-entry" style="margin-left: 1em;">
<a href="#clojure.java.process/to-file" class="toc-entry-anchor">to-file</a>
</div>
</div><div class="toc-section" style="margin-left: 1em;">
<a style="margin-top: 3px;" href="#"></a>
</div>
</div>
</div>
<div id="content-tag"><h1 id="overview">API for <span id="clojure.java.process">clojure.java.process</span>
- <span id="header-project">Clojure</span> <span id="header-version">v1.12.4</span><span id="header-status-block"> (<span id="header-status">stable</span>)</span>
</h1>
<br />Full namespace name: <span id="long-name">clojure.java.process</span>
<p></p>
<h2>Overview</h2>
<pre id="namespace-docstr">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.</pre>
<br />
<div id="var-section">
<p></p>
<h2>Public Variables and Functions</h2>
<div id="var-entry">
<br />
<hr />
<h2 id="clojure.java.process/exec">exec</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (exec & opts+args)
</pre>
<pre id="var-docstr">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.</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/afbd2098bf741234ec9efaa25480d02b14863e8c/src/clj/clojure/java/process.clj#L163">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.java.process/exit-ref">exit-ref</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (exit-ref process)
</pre>
<pre id="var-docstr">Given a Process (the output of 'start'), return a reference that can be
used to wait for process completion then returns the exit value.</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/afbd2098bf741234ec9efaa25480d02b14863e8c/src/clj/clojure/java/process.clj#L114">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.java.process/from-file">from-file</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (from-file f)
</pre>
<pre id="var-docstr">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.</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/afbd2098bf741234ec9efaa25480d02b14863e8c/src/clj/clojure/java/process.clj#L46">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.java.process/start">start</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (start & opts+args)
</pre>
<pre id="var-docstr">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.</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/afbd2098bf741234ec9efaa25480d02b14863e8c/src/clj/clojure/java/process.clj#L53">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.java.process/stderr">stderr</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (stderr process)
</pre>
<pre id="var-docstr">Given a process, return the stderr of the external process (an InputStream)</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/afbd2098bf741234ec9efaa25480d02b14863e8c/src/clj/clojure/java/process.clj#L108">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.java.process/stdin">stdin</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (stdin process)
</pre>
<pre id="var-docstr">Given a process, return the stdin of the external process (an OutputStream)</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/afbd2098bf741234ec9efaa25480d02b14863e8c/src/clj/clojure/java/process.clj#L96">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.java.process/stdout">stdout</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (stdout process)
</pre>
<pre id="var-docstr">Given a process, return the stdout of the external process (an InputStream)</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/afbd2098bf741234ec9efaa25480d02b14863e8c/src/clj/clojure/java/process.clj#L102">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.java.process/to-file">to-file</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (to-file f & {:keys [append], :as opts})
</pre>
<pre id="var-docstr">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.</pre>
<pre id="var-specs"></pre>
<span class="var-added"><span id="content">Added in Clojure version 1.12</span><br /></span>
<a id="var-source" href="https://github.com/clojure/clojure/blob/afbd2098bf741234ec9efaa25480d02b14863e8c/src/clj/clojure/java/process.clj#L36">Source</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="foot">
<div id="copyright" style="text-align: center;">Copyright 2007-2025 by Rich Hickey</div>
</div>
</div>
<div id="DesignedBy">Logo & site design by <a href="http://www.tomhickey.com" title="Visit Tom Hickey's website.">Tom Hickey</a>.<br />
Clojure auto-documentation system by Tom Faulhaber.</div>
</div>
<!-- /AllContentContainer -->
</body>
</html>