1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>Chgrp Task</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="Chgrp">Chgrp</a></h2>
|
---|
28 | <p><em>Since Ant 1.6.</em></p>
|
---|
29 | <h3>Description</h3>
|
---|
30 |
|
---|
31 | <p>Changes the group of a file or all files inside specified
|
---|
32 | directories. Right now it has effect only under Unix. The group
|
---|
33 | attribute is equivalent to the corresponding argument for the chgrp
|
---|
34 | command.</p>
|
---|
35 |
|
---|
36 | <p><a href="../CoreTypes/fileset.html">FileSet</a>s,
|
---|
37 | <a href="../CoreTypes/dirset.html">DirSet</a>s or <a
|
---|
38 | href="../CoreTypes/filelist.html">FileList</a>s can be specified using
|
---|
39 | nested <code><fileset></code>, <code><dirset></code> and
|
---|
40 | <code><filelist></code> elements.</p>
|
---|
41 |
|
---|
42 | <p>Starting with Ant 1.7, this task supports arbitrary <a
|
---|
43 | href="../CoreTypes/resources.html#collection">Resource Collection</a>s
|
---|
44 | as nested elements.</p>
|
---|
45 |
|
---|
46 | <p>By default this task will use a single invocation of the underlying
|
---|
47 | chgrp command. If you are working on a large number of files this may
|
---|
48 | result in a command line that is too long for your operating system.
|
---|
49 | If you encounter such problems, you should set the maxparallel
|
---|
50 | attribute of this task to a non-zero value. The number to use highly
|
---|
51 | depends on the length of your file names (the depth of your directory
|
---|
52 | tree) and your operating system, so you'll have to experiment a
|
---|
53 | little. POSIX recommends command line length limits of at least 4096
|
---|
54 | characters, this may give you an approximation for the number you
|
---|
55 | could use as initial value for these experiments.</p>
|
---|
56 |
|
---|
57 | <h3>Parameters</h3>
|
---|
58 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
59 | <tr>
|
---|
60 | <td valign="top"><b>Attribute</b></td>
|
---|
61 | <td valign="top"><b>Description</b></td>
|
---|
62 | <td align="center" valign="top"><b>Required</b></td>
|
---|
63 | </tr>
|
---|
64 | <tr>
|
---|
65 | <td valign="top">file</td>
|
---|
66 | <td valign="top">the file or directory of which the group must be
|
---|
67 | changed.</td>
|
---|
68 | <td valign="top" valign="middle">Yes, unless nested
|
---|
69 | <code><fileset|filelist|dirset></code>
|
---|
70 | elements are specified</td>
|
---|
71 | </tr>
|
---|
72 | <tr>
|
---|
73 | <td valign="top">group</td>
|
---|
74 | <td valign="top">the new group.</td>
|
---|
75 | <td valign="top" align="center">Yes</td>
|
---|
76 | </tr>
|
---|
77 | <tr>
|
---|
78 | <td valign="top">parallel</td>
|
---|
79 | <td valign="top">process all specified files using a single
|
---|
80 | <code>chgrp</code> command. Defaults to true.</td>
|
---|
81 | <td valign="top" align="center">No</td>
|
---|
82 | </tr>
|
---|
83 | <tr>
|
---|
84 | <td valign="top">type</td>
|
---|
85 | <td valign="top">One of <i>file</i>, <i>dir</i> or
|
---|
86 | <i>both</i>. If set to <i>file</i>, only the group of
|
---|
87 | plain files are going to be changed. If set to <i>dir</i>, only
|
---|
88 | the directories are considered.<br>
|
---|
89 | <strong>Note:</strong> The type attribute does not apply to
|
---|
90 | nested <i>dirset</i>s - <i>dirset</i>s always implicitly
|
---|
91 | assume type to be <i>dir</i>.</td>
|
---|
92 | <td align="center" valign="top">No, default is <i>file</i></td>
|
---|
93 | </tr>
|
---|
94 | <tr>
|
---|
95 | <td valign="top">maxparallel</td>
|
---|
96 | <td valign="top">Limit the amount of parallelism by passing at
|
---|
97 | most this many sourcefiles at once. Set it to <= 0 for
|
---|
98 | unlimited. Defaults to unlimited.</td>
|
---|
99 | <td align="center" valign="top">No</td>
|
---|
100 |
|
---|
101 | </tr>
|
---|
102 | <tr>
|
---|
103 | <td valign="top">verbose</td>
|
---|
104 | <td valign="top">Whether to print a summary after execution or not.
|
---|
105 | Defaults to <code>false</code>.</td>
|
---|
106 | <td align="center" valign="top">No</td>
|
---|
107 | </tr>
|
---|
108 |
|
---|
109 | </table>
|
---|
110 | <h3>Examples</h3>
|
---|
111 | <blockquote><pre>
|
---|
112 | <chgrp file="${dist}/start.sh" group="coders"/>
|
---|
113 | </pre>
|
---|
114 | </blockquote>
|
---|
115 | <p>makes the "start.sh" file belong to the coders group on a
|
---|
116 | UNIX system.</p>
|
---|
117 | <blockquote>
|
---|
118 | <pre>
|
---|
119 | <chgrp group="coders">
|
---|
120 | <fileset dir="${dist}/bin" includes="**/*.sh"/>
|
---|
121 | </chgrp>
|
---|
122 | </pre>
|
---|
123 | </blockquote>
|
---|
124 | <p>makes all ".sh" files below <code>${dist}/bin</code>
|
---|
125 | belong to the coders group on a UNIX system.</p>
|
---|
126 | <blockquote>
|
---|
127 | <pre>
|
---|
128 | <chgrp group="coders">
|
---|
129 | <fileset dir="shared/sources1">
|
---|
130 | <exclude name="**/trial/**"/>
|
---|
131 | </fileset>
|
---|
132 | <fileset refid="other.shared.sources"/>
|
---|
133 | </chgrp>
|
---|
134 | </pre>
|
---|
135 | </blockquote>
|
---|
136 | <p>makes all files below <code>shared/sources1</code> (except those
|
---|
137 | below any directory named trial) belong to the coders group on a UNIX
|
---|
138 | system. In addition all files belonging to a FileSet
|
---|
139 | with <code>id</code> <code>other.shared.sources</code> get the same
|
---|
140 | group.</p>
|
---|
141 |
|
---|
142 | <blockquote>
|
---|
143 | <pre>
|
---|
144 | <chgrp group="webdev" type="file">
|
---|
145 | <fileset dir="/web">
|
---|
146 | <include name="**/*.test.jsp"/>
|
---|
147 | <include name="**/*.new"/>
|
---|
148 | </fileset>
|
---|
149 | <dirset dir="/web">
|
---|
150 | <include name="**/test_*"/>
|
---|
151 | </dirset>
|
---|
152 | </chmod>
|
---|
153 | </pre>
|
---|
154 | </blockquote>
|
---|
155 |
|
---|
156 | <p>makes all <code>.test.jsp</code>, and <code>.new</code> files belong to
|
---|
157 | group webdev. Directories beginning with <code>test_</code> also will belong
|
---|
158 | to webdev, but if there is a directory that ends in <code>.new</code> or a file
|
---|
159 | that begins with <code>test_</code> it will be unaffected.</p>
|
---|
160 |
|
---|
161 |
|
---|
162 |
|
---|
163 |
|
---|
164 | </body>
|
---|
165 | </html>
|
---|
166 |
|
---|