1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>Chown Task</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="Chown">Chown</a></h2>
|
---|
12 | <p><em>Since Ant 1.6.</em></p>
|
---|
13 | <h3>Description</h3>
|
---|
14 |
|
---|
15 | <p>Changes the owner of a file or all files inside specified
|
---|
16 | directories. Right now it has effect only under Unix. The owner
|
---|
17 | atribute is equivalent to the coresponding argument for the chown
|
---|
18 | command.</p>
|
---|
19 |
|
---|
20 | <p><a href="../CoreTypes/fileset.html">FileSet</a>s,
|
---|
21 | <a href="../CoreTypes/dirset.html">DirSet</a>s or <a
|
---|
22 | href="../CoreTypes/filelist.html">FileList</a>s can be specified using
|
---|
23 | nested <code><fileset></code>, <code><dirset></code> and
|
---|
24 | <code><filelist></code> elements.</p>
|
---|
25 |
|
---|
26 |
|
---|
27 | <h3>Parameters</h3>
|
---|
28 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
29 | <tr>
|
---|
30 | <td valign="top"><b>Attribute</b></td>
|
---|
31 | <td valign="top"><b>Description</b></td>
|
---|
32 | <td align="center" valign="top"><b>Required</b></td>
|
---|
33 | </tr>
|
---|
34 | <tr>
|
---|
35 | <td valign="top">file</td>
|
---|
36 | <td valign="top">the file or directory of which the owner must be
|
---|
37 | changed.</td>
|
---|
38 | <td valign="top" valign="middle">Yes or nested
|
---|
39 | <code><fileset/list></code> elements.</td>
|
---|
40 | </tr>
|
---|
41 | <tr>
|
---|
42 | <td valign="top">owner</td>
|
---|
43 | <td valign="top">the new owner.</td>
|
---|
44 | <td valign="top" align="center">Yes</td>
|
---|
45 | </tr>
|
---|
46 | <tr>
|
---|
47 | <td valign="top">parallel</td>
|
---|
48 | <td valign="top">process all specified files using a single
|
---|
49 | <code>chown</code> command. Defaults to true.</td>
|
---|
50 | <td valign="top" align="center">No</td>
|
---|
51 | </tr>
|
---|
52 | <tr>
|
---|
53 | <td valign="top">type</td>
|
---|
54 | <td valign="top">One of <i>file</i>, <i>dir</i> or
|
---|
55 | <i>both</i>. If set to <i>file</i>, only the owner of
|
---|
56 | plain files are going to be changed. If set to <i>dir</i>, only
|
---|
57 | the directories are considered.<br>
|
---|
58 | <strong>Note:</strong> The type attribute does not apply to
|
---|
59 | nested <i>dirset</i>s - <i>dirset</i>s always implicitly
|
---|
60 | assume type to be <i>dir</i>.</td>
|
---|
61 | <td align="center" valign="top">No, default is <i>file</i></td>
|
---|
62 | </tr>
|
---|
63 | <tr>
|
---|
64 | <td valign="top">maxparallel</td>
|
---|
65 | <td valign="top">Limit the amount of parallelism by passing at
|
---|
66 | most this many sourcefiles at once. Set it to <= 0 for
|
---|
67 | unlimited. Defaults to unlimited.</td>
|
---|
68 | <td align="center" valign="top">No</td>
|
---|
69 |
|
---|
70 | </tr>
|
---|
71 | <tr>
|
---|
72 | <td valign="top">verbose</td>
|
---|
73 | <td valign="top">Whether to print a summary after execution or not.
|
---|
74 | Defaults to <code>false</code>.</td>
|
---|
75 | <td align="center" valign="top">No</td>
|
---|
76 | </tr>
|
---|
77 |
|
---|
78 | </table>
|
---|
79 | <h3>Examples</h3>
|
---|
80 | <blockquote>
|
---|
81 | <p><code><chown file="${dist}/start.sh" owner="coderjoe"/></code></p>
|
---|
82 | </blockquote>
|
---|
83 | <p>makes the "start.sh" file belong to coderjoe on a
|
---|
84 | UNIX system.</p>
|
---|
85 | <blockquote>
|
---|
86 | <pre>
|
---|
87 | <chown owner="coderjoe">
|
---|
88 | <fileset dir="${dist}/bin" includes="**/*.sh"/>
|
---|
89 | </chown>
|
---|
90 | </pre>
|
---|
91 | </blockquote>
|
---|
92 | <p>makes all ".sh" files below <code>${dist}/bin</code>
|
---|
93 | belong to coderjoe on a UNIX system.</p>
|
---|
94 | <blockquote>
|
---|
95 | <pre>
|
---|
96 | <chown owner="coderjoe">
|
---|
97 | <fileset dir="shared/sources1">
|
---|
98 | <exclude name="**/trial/**"/>
|
---|
99 | </fileset>
|
---|
100 | <fileset refid="other.shared.sources"/>
|
---|
101 | </chown>
|
---|
102 | </pre>
|
---|
103 | </blockquote>
|
---|
104 | <p>makes all files below <code>shared/sources1</code> (except those
|
---|
105 | below any directory named trial) belong to coderjoe on a UNIX
|
---|
106 | system. In addition all files belonging to a FileSet
|
---|
107 | with <code>id</code> <code>other.shared.sources</code> get the same
|
---|
108 | owner.</p>
|
---|
109 |
|
---|
110 | <blockquote>
|
---|
111 | <pre>
|
---|
112 | <chown owner="webadmin" type="file">
|
---|
113 | <fileset dir="/web">
|
---|
114 | <include name="**/*.cgi"/>
|
---|
115 | <include name="**/*.old"/>
|
---|
116 | </fileset>
|
---|
117 | <dirset dir="/web">
|
---|
118 | <include name="**/private_*"/>
|
---|
119 | </dirset>
|
---|
120 | </chmod>
|
---|
121 | </pre>
|
---|
122 | </blockquote>
|
---|
123 |
|
---|
124 | <p>makes cgi scripts, files with a <code>.old</code> extension or
|
---|
125 | directories begining with <code>private_</code> belong to the user named
|
---|
126 | webadmin. A directory ending in <code>.old</code> or a file begining with
|
---|
127 | <code>private_</code> would remain unaffected.</p>
|
---|
128 |
|
---|
129 | <hr>
|
---|
130 | <p align="center">Copyright © 2002-2004 The Apache Software
|
---|
131 | Foundation. All rights Reserved.</p>
|
---|
132 |
|
---|
133 | </body>
|
---|
134 | </html>
|
---|
135 |
|
---|