forked from Uriziel47/ant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chgrp.html
185 lines (165 loc) · 6.56 KB
/
chgrp.html
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
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>Chgrp Task</title>
</head>
<body>
<h2><a name="Chgrp">Chgrp</a></h2>
<p><em>Since Apache Ant 1.6.</em></p>
<h3>Description</h3>
<p>Changes the group of a file or all files inside specified
directories. Right now it has effect only under Unix. The group
attribute is equivalent to the corresponding argument for the chgrp
command.</p>
<p><a href="../Types/fileset.html">FileSet</a>s,
<a href="../Types/dirset.html">DirSet</a>s or <a
href="../Types/filelist.html">FileList</a>s can be specified using
nested <code><fileset></code>, <code><dirset></code> and
<code><filelist></code> elements.</p>
<p>Starting with Ant 1.7, this task supports arbitrary <a
href="../Types/resources.html#collection">Resource Collection</a>s
as nested elements.</p>
<p>By default this task will use a single invocation of the underlying
chgrp command. If you are working on a large number of files this may
result in a command line that is too long for your operating system.
If you encounter such problems, you should set the maxparallel
attribute of this task to a non-zero value. The number to use highly
depends on the length of your file names (the depth of your directory
tree) and your operating system, so you'll have to experiment a
little. POSIX recommends command line length limits of at least 4096
characters, this may give you an approximation for the number you
could use as initial value for these experiments.</p>
<p>By default this task won't do anything unless it detects it is
running on a Unix system. If you know for sure that you have a
"chgrp" executable on your PATH that is command line compatible with
the Unix command, you can use the task's os attribute and set its
value to your current os.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">file</td>
<td valign="top">the file or directory of which the group must be
changed.</td>
<td valign="top" valign="middle">Yes, unless nested
<code><fileset|filelist|dirset></code>
elements are specified</td>
</tr>
<tr>
<td valign="top">group</td>
<td valign="top">the new group.</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td valign="top">parallel</td>
<td valign="top">process all specified files using a single
<code>chgrp</code> command. Defaults to true.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">One of <i>file</i>, <i>dir</i> or
<i>both</i>. If set to <i>file</i>, only the group of
plain files are going to be changed. If set to <i>dir</i>, only
the directories are considered.<br>
<strong>Note:</strong> The type attribute does not apply to
nested <i>dirset</i>s - <i>dirset</i>s always implicitly
assume type to be <i>dir</i>.</td>
<td align="center" valign="top">No, default is <i>file</i></td>
</tr>
<tr>
<td valign="top">maxparallel</td>
<td valign="top">Limit the amount of parallelism by passing at
most this many sourcefiles at once. Set it to <= 0 for
unlimited. Defaults to unlimited.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">Whether to print a summary after execution or not.
Defaults to <code>false</code>.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">os</td>
<td valign="top">list of Operating Systems on which the command may be
executed.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">osfamily</td>
<td valign="top">OS family as used in
the <a href="../Tasks/conditions.html#os"><os></a>
condition.</td>
<td align="center" valign="top">No - defaults to "unix"</td>
</tr>
</table>
<h3>Examples</h3>
<blockquote><pre>
<chgrp file="${dist}/start.sh" group="coders"/>
</pre>
</blockquote>
<p>makes the "start.sh" file belong to the coders group on a
UNIX system.</p>
<blockquote>
<pre>
<chgrp group="coders">
<fileset dir="${dist}/bin" includes="**/*.sh"/>
</chgrp>
</pre>
</blockquote>
<p>makes all ".sh" files below <code>${dist}/bin</code>
belong to the coders group on a UNIX system.</p>
<blockquote>
<pre>
<chgrp group="coders">
<fileset dir="shared/sources1">
<exclude name="**/trial/**"/>
</fileset>
<fileset refid="other.shared.sources"/>
</chgrp>
</pre>
</blockquote>
<p>makes all files below <code>shared/sources1</code> (except those
below any directory named trial) belong to the coders group on a UNIX
system. In addition all files belonging to a FileSet
with <code>id</code> <code>other.shared.sources</code> get the same
group.</p>
<blockquote>
<pre>
<chgrp group="webdev" type="file">
<fileset dir="/web">
<include name="**/*.test.jsp"/>
<include name="**/*.new"/>
</fileset>
<dirset dir="/web">
<include name="**/test_*"/>
</dirset>
</chmod>
</pre>
</blockquote>
<p>makes all <code>.test.jsp</code>, and <code>.new</code> files belong to
group webdev. Directories beginning with <code>test_</code> also will belong
to webdev, but if there is a directory that ends in <code>.new</code> or a file
that begins with <code>test_</code> it will be unaffected.</p>
</body>
</html>