source: release-kits/lirk3/bin/ant-installer/web/manual1.6.2/manual/CoreTypes/redirector.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 6.0 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Redirector Type</title>
6</head>
7
8<body>
9
10<h2><a name="redirector">I/O redirection</a></h2>
11<p>For many tasks, input and output can be defined in a fairly
12straightforward fashion. The <a href="../CoreTasks/exec.html">exec</a>
13task, used to execute an external process, stands as a very
14basic example. The executed process may accept input, produce
15output, or do either or both depending upon various circumstances.
16Output may be classified as &quot;output&quot; or as &quot;error
17output.&quot; The &lt;redirector&gt; type provides a concrete means
18of redirecting input and output featuring the use of
19<a href="./mapper.html">File Mapper</a>s to specify
20source (input) and destination (output/error) files. <em>Since Ant 1.6.2</em>
21<p>The <code>&lt;redirector&gt;</code> element accepts the following attributes:</p>
22<table border="1" cellpadding="2" cellspacing="0">
23 <tr>
24 <td valign="top"><b>Attribute</b></td>
25 <td valign="top"><b>Description</b></td>
26 <td align="center" valign="top"><b>Required</b></td>
27 </tr>
28 <tr>
29 <td valign="top">output</td>
30 <td valign="top">Name of a file to which to write the output. If the error stream
31 is not also redirected to a file or property, it will appear in this output.</td>
32 <td align="center" valign="top">No</td>
33 </tr>
34 <tr>
35 <td valign="top">error</td>
36 <td valign="top">The file to which the standard error of the
37 command should be redirected.</td>
38 <td align="center" valign="top">No</td>
39 </tr>
40 <tr>
41 <td valign="top">logError</td>
42 <td valign="top">This attribute is used when you wish to see error output in Ant's
43 log and you are redirecting output to a file/property. The error
44 output will not be included in the output file/property. If you
45 redirect error with the <i>error</i> or <i>errorProperty</i>
46 attributes, this will have no effect.</td>
47 <td align="center" valign="top">No</td>
48 </tr>
49 <tr>
50 <td valign="top">append</td>
51 <td valign="top">Whether output and error files should be appended to or overwritten.
52 Defaults to <code>false</code>.</td>
53 <td align="center" valign="top">No</td>
54 </tr>
55 <tr>
56 <td valign="top">createemptyfiles</td>
57 <td valign="top">Whether output and error files should be created even when empty.
58 Defaults to <code>true</code>.</td>
59 <td align="center" valign="top">No</td>
60 </tr>
61 <tr>
62 <td valign="top">outputproperty</td>
63 <td valign="top">The name of a property in which the output of the
64 command should be stored. Unless the error stream is redirected to a separate
65 file or stream, this property will include the error output.</td>
66 <td align="center" valign="top">No</td>
67 </tr>
68 <tr>
69 <td valign="top">errorproperty</td>
70 <td valign="top">The name of a property in which the standard error of the
71 command should be stored.</td>
72 <td align="center" valign="top">No</td>
73 </tr>
74 <tr>
75 <td valign="top">input</td>
76 <td valign="top">A file from which the executed command's standard input
77 is taken. This attribute is mutually exclusive with the
78 <i>inputstring</i> attribute.</td>
79 <td align="center" valign="top">No</td>
80 </tr>
81 <tr>
82 <td valign="top">inputstring</td>
83 <td valign="top">A string which serves as the input stream for the
84 executed command. This attribute is mutually exclusive with the
85 <i>input</i> attribute.</td>
86 <td align="center" valign="top">No</td>
87 </tr>
88 <tr>
89 <td valign="top">inputencoding</td>
90 <td valign="top">The input encoding.</td>
91 <td align="center" valign="top">No</td>
92 </tr>
93 <tr>
94 <td valign="top">outputencoding</td>
95 <td valign="top">The output encoding.</td>
96 <td align="center" valign="top">No</td>
97 </tr>
98 <tr>
99 <td valign="top">errorencoding</td>
100 <td valign="top">The error encoding.</td>
101 <td align="center" valign="top">No</td>
102 </tr>
103</table>
104<h3>Parameters specified as nested elements</h3>
105<h4>inputmapper</h4>
106<p>A single <a href="./mapper.html">File Mapper</a> used to redirect process
107input. Multiple mapping results should concatenate all mapped files as input.
108Mapping will ordinarily be performed on a task-specified sourcefile;
109consult the documentation of the individual task for more details.
110A nested &lt;inputmapper&gt; is not compatible with either of the
111<i>input</i> or <i>inputstring</i> attributes.</p>
112<h4>outputmapper</h4>
113<p>A single <a href="./mapper.html">File Mapper</a> used to redirect process
114output. Mapping will ordinarily be performed on a task-specified sourcefile;
115consult the documentation of the individual task for more details.
116A nested &lt;outputmapper&gt; is not compatible with the
117<i>output</i> attribute.</p>
118<h4>errormapper</h4>
119<p>A single <a href="./mapper.html">File Mapper</a> used to redirect error
120output. Mapping will ordinarily be performed on a task-specified sourcefile;
121consult the documentation of the individual task for more details.
122A nested &lt;errormapper&gt; is not compatible with the
123<i>error</i> attribute.</p>
124<h4>inputfilterchain</h4>
125<p>One or more <a href="./filterchain.html">FilterChain</a>s can be
126applied to the process input.</p>
127<h4>outputfilterchain</h4>
128<p>One or more <a href="./filterchain.html">FilterChain</a>s can be
129applied to the process output.</p>
130<h4>errorfilterchain</h4>
131<p>One or more <a href="./filterchain.html">FilterChain</a>s can be
132applied to the error output.</p>
133<h3>Usage</h3>
134Tasks known to support I/O redirection:
135<ul>
136<li><a href="../CoreTasks/exec.html">Exec</a></li>
137<li><a href="../CoreTasks/apply.html">Apply</a></li>
138<li><a href="../CoreTasks/java.html">Java</a></li>
139</ul>
140<p>The expected behavior of a &lt;redirector&gt; is to a great degree
141dependent on the supporting task. Any possible points of confusion
142should be noted at the task level.</p>
143<hr />
144<p align="center">Copyright &copy; 2004 The Apache Software Foundation. All rights
145Reserved.</p>
146
147</body>
148</html>
149
Note: See TracBrowser for help on using the repository browser.