source: release-kits/lirk3/bin/ant-installer/web/manual/manual/OptionalTasks/chgrp.html@ 14982

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

initial import of LiRK3

File size: 5.9 KB
Line 
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
32directories. Right now it has effect only under Unix. The group
33attribute is equivalent to the corresponding argument for the chgrp
34command.</p>
35
36<p><a href="../CoreTypes/fileset.html">FileSet</a>s,
37<a href="../CoreTypes/dirset.html">DirSet</a>s or <a
38href="../CoreTypes/filelist.html">FileList</a>s can be specified using
39nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and
40<code>&lt;filelist&gt;</code> elements.</p>
41
42<p>Starting with Ant 1.7, this task supports arbitrary <a
43href="../CoreTypes/resources.html#collection">Resource Collection</a>s
44as nested elements.</p>
45
46<p>By default this task will use a single invocation of the underlying
47chgrp command. If you are working on a large number of files this may
48result in a command line that is too long for your operating system.
49If you encounter such problems, you should set the maxparallel
50attribute of this task to a non-zero value. The number to use highly
51depends on the length of your file names (the depth of your directory
52tree) and your operating system, so you'll have to experiment a
53little. POSIX recommends command line length limits of at least 4096
54characters, this may give you an approximation for the number you
55could 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>&lt;fileset|filelist|dirset&gt;</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 &lt;= 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&lt;chgrp file=&quot;${dist}/start.sh&quot; group=&quot;coders&quot;/&gt;
113</pre>
114</blockquote>
115<p>makes the &quot;start.sh&quot; file belong to the coders group on a
116UNIX system.</p>
117<blockquote>
118<pre>
119&lt;chgrp group=&quot;coders&quot;&gt;
120 &lt;fileset dir=&quot;${dist}/bin&quot; includes=&quot;**/*.sh&quot;/&gt;
121&lt;/chgrp&gt;
122</pre>
123</blockquote>
124<p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
125belong to the coders group on a UNIX system.</p>
126<blockquote>
127<pre>
128&lt;chgrp group=&quot;coders&quot;&gt;
129 &lt;fileset dir=&quot;shared/sources1&quot;&gt;
130 &lt;exclude name=&quot;**/trial/**&quot;/&gt;
131 &lt;/fileset&gt;
132 &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
133&lt;/chgrp&gt;
134</pre>
135</blockquote>
136<p>makes all files below <code>shared/sources1</code> (except those
137below any directory named trial) belong to the coders group on a UNIX
138system. In addition all files belonging to a FileSet
139with <code>id</code> <code>other.shared.sources</code> get the same
140group.</p>
141
142<blockquote>
143<pre>
144&lt;chgrp group=&quot;webdev&quot; type=&quot;file&quot;&gt;
145 &lt;fileset dir=&quot;/web&quot;&gt;
146 &lt;include name=&quot;**/*.test.jsp&quot;/&gt;
147 &lt;include name=&quot;**/*.new&quot;/&gt;
148 &lt;/fileset&gt;
149 &lt;dirset dir=&quot;/web&quot;&gt;
150 &lt;include name=&quot;**/test_*&quot;/&gt;
151 &lt;/dirset&gt;
152&lt;/chmod&gt;
153</pre>
154</blockquote>
155
156<p>makes all <code>.test.jsp</code>, and <code>.new</code> files belong to
157group webdev. Directories beginning with <code>test_</code> also will belong
158to webdev, but if there is a directory that ends in <code>.new</code> or a file
159that begins with <code>test_</code> it will be unaffected.</p>
160
161
162
163
164</body>
165</html>
166
Note: See TracBrowser for help on using the repository browser.