source: release-kits/lirk3/resources/gs3-release-maker/apache-ant-1.6.5/docs/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.0 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Chgrp Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="Chgrp">Chgrp</a></h2>
12<p><em>Since Ant 1.6.</em></p>
13<h3>Description</h3>
14
15<p>Changes the group of a file or all files inside specified
16directories. Right now it has effect only under Unix. The group
17atribute is equivalent to the coresponding argument for the chgrp
18command.</p>
19
20<p><a href="../CoreTypes/fileset.html">FileSet</a>s,
21<a href="../CoreTypes/dirset.html">DirSet</a>s or <a
22href="../CoreTypes/filelist.html">FileList</a>s can be specified using
23nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and
24<code>&lt;filelist&gt;</code> elements.</p>
25
26<p>By default this task will use a single invocation of the underlying
27chgrp command. If you are working on a large number of files this may
28result in a command line that is too long for your operating system.
29If you encounter such problems, you should set the maxparallel
30attribute of this task to a non-zero value. The number to use highly
31depends on the length of your file names (the depth of your directory
32tree) and your operating system, so you'll have to experiment a
33little. POSIX recommends command line length limits of at least 4096
34characters, this may give you an approximation for the number you
35could use as initial value for these experiments.</p>
36
37<h3>Parameters</h3>
38<table border="1" cellpadding="2" cellspacing="0">
39 <tr>
40 <td valign="top"><b>Attribute</b></td>
41 <td valign="top"><b>Description</b></td>
42 <td align="center" valign="top"><b>Required</b></td>
43 </tr>
44 <tr>
45 <td valign="top">file</td>
46 <td valign="top">the file or directory of which the group must be
47 changed.</td>
48 <td valign="top" valign="middle">Yes or nested
49 <code>&lt;fileset/list&gt;</code> elements.</td>
50 </tr>
51 <tr>
52 <td valign="top">group</td>
53 <td valign="top">the new group.</td>
54 <td valign="top" align="center">Yes</td>
55 </tr>
56 <tr>
57 <td valign="top">parallel</td>
58 <td valign="top">process all specified files using a single
59 <code>chgrp</code> command. Defaults to true.</td>
60 <td valign="top" align="center">No</td>
61 </tr>
62 <tr>
63 <td valign="top">type</td>
64 <td valign="top">One of <i>file</i>, <i>dir</i> or
65 <i>both</i>. If set to <i>file</i>, only the group of
66 plain files are going to be changed. If set to <i>dir</i>, only
67 the directories are considered.<br>
68 <strong>Note:</strong> The type attribute does not apply to
69 nested <i>dirset</i>s - <i>dirset</i>s always implicitly
70 assume type to be <i>dir</i>.</td>
71 <td align="center" valign="top">No, default is <i>file</i></td>
72 </tr>
73 <tr>
74 <td valign="top">maxparallel</td>
75 <td valign="top">Limit the amount of parallelism by passing at
76 most this many sourcefiles at once. Set it to &lt;= 0 for
77 unlimited. Defaults to unlimited.</td>
78 <td align="center" valign="top">No</td>
79
80 </tr>
81 <tr>
82 <td valign="top">verbose</td>
83 <td valign="top">Whether to print a summary after execution or not.
84 Defaults to <code>false</code>.</td>
85 <td align="center" valign="top">No</td>
86 </tr>
87
88</table>
89<h3>Examples</h3>
90<blockquote>
91 <p><code>&lt;chgrp file=&quot;${dist}/start.sh&quot; group=&quot;coders&quot;/&gt;</code></p>
92</blockquote>
93<p>makes the &quot;start.sh&quot; file belong to the coders group on a
94UNIX system.</p>
95<blockquote>
96<pre>
97&lt;chgrp group=&quot;coders&quot;&gt;
98 &lt;fileset dir=&quot;${dist}/bin&quot; includes=&quot;**/*.sh&quot;/&gt;
99&lt;/chgrp&gt;
100</pre>
101</blockquote>
102<p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
103belong to the coders group on a UNIX system.</p>
104<blockquote>
105<pre>
106&lt;chgrp group=&quot;coders&quot;&gt;
107 &lt;fileset dir=&quot;shared/sources1&quot;&gt;
108 &lt;exclude name=&quot;**/trial/**&quot;/&gt;
109 &lt;/fileset&gt;
110 &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
111&lt;/chgrp&gt;
112</pre>
113</blockquote>
114<p>makes all files below <code>shared/sources1</code> (except those
115below any directory named trial) belong to the coders group on a UNIX
116system. In addition all files belonging to a FileSet
117with <code>id</code> <code>other.shared.sources</code> get the same
118group.</p>
119
120<blockquote>
121<pre>
122&lt;chgrp group=&quot;webdev&quot; type=&quot;file&quot;&gt;
123 &lt;fileset dir=&quot;/web&quot;&gt;
124 &lt;include name=&quot;**/*.test.jsp&quot;/&gt;
125 &lt;include name=&quot;**/*.new&quot;/&gt;
126 &lt;/fileset&gt;
127 &lt;dirset dir=&quot;/web&quot;&gt;
128 &lt;include name=&quot;**/test_*&quot;/&gt;
129 &lt;/dirset&gt;
130&lt;/chmod&gt;
131</pre>
132</blockquote>
133
134<p>makes all <code>.test.jsp</code>, and <code>.new</code> files belong to
135group webdev. Directories beginning with <code>test_</code> also will belong
136to webdev, but if there is a directory that ends in <code>.new</code> or a file
137that begins with <code>test_</code> it will be unaffected.</p>
138
139
140<hr>
141<p align="center">Copyright &copy; 2002-2004 The Apache Software
142Foundation. All rights Reserved.</p>
143
144</body>
145</html>
146
Note: See TracBrowser for help on using the repository browser.