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
|
---|
16 | directories. Right now it has effect only under Unix. The group
|
---|
17 | atribute is equivalent to the coresponding argument for the chgrp
|
---|
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 | <p>By default this task will use a single invocation of the underlying
|
---|
27 | chgrp command. If you are working on a large number of files this may
|
---|
28 | result in a command line that is too long for your operating system.
|
---|
29 | If you encounter such problems, you should set the maxparallel
|
---|
30 | attribute of this task to a non-zero value. The number to use highly
|
---|
31 | depends on the length of your file names (the depth of your directory
|
---|
32 | tree) and your operating system, so you'll have to experiment a
|
---|
33 | little. POSIX recommends command line length limits of at least 4096
|
---|
34 | characters, this may give you an approximation for the number you
|
---|
35 | could 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><fileset/list></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 <= 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><chgrp file="${dist}/start.sh" group="coders"/></code></p>
|
---|
92 | </blockquote>
|
---|
93 | <p>makes the "start.sh" file belong to the coders group on a
|
---|
94 | UNIX system.</p>
|
---|
95 | <blockquote>
|
---|
96 | <pre>
|
---|
97 | <chgrp group="coders">
|
---|
98 | <fileset dir="${dist}/bin" includes="**/*.sh"/>
|
---|
99 | </chgrp>
|
---|
100 | </pre>
|
---|
101 | </blockquote>
|
---|
102 | <p>makes all ".sh" files below <code>${dist}/bin</code>
|
---|
103 | belong to the coders group on a UNIX system.</p>
|
---|
104 | <blockquote>
|
---|
105 | <pre>
|
---|
106 | <chgrp group="coders">
|
---|
107 | <fileset dir="shared/sources1">
|
---|
108 | <exclude name="**/trial/**"/>
|
---|
109 | </fileset>
|
---|
110 | <fileset refid="other.shared.sources"/>
|
---|
111 | </chgrp>
|
---|
112 | </pre>
|
---|
113 | </blockquote>
|
---|
114 | <p>makes all files below <code>shared/sources1</code> (except those
|
---|
115 | below any directory named trial) belong to the coders group on a UNIX
|
---|
116 | system. In addition all files belonging to a FileSet
|
---|
117 | with <code>id</code> <code>other.shared.sources</code> get the same
|
---|
118 | group.</p>
|
---|
119 |
|
---|
120 | <blockquote>
|
---|
121 | <pre>
|
---|
122 | <chgrp group="webdev" type="file">
|
---|
123 | <fileset dir="/web">
|
---|
124 | <include name="**/*.test.jsp"/>
|
---|
125 | <include name="**/*.new"/>
|
---|
126 | </fileset>
|
---|
127 | <dirset dir="/web">
|
---|
128 | <include name="**/test_*"/>
|
---|
129 | </dirset>
|
---|
130 | </chmod>
|
---|
131 | </pre>
|
---|
132 | </blockquote>
|
---|
133 |
|
---|
134 | <p>makes all <code>.test.jsp</code>, and <code>.new</code> files belong to
|
---|
135 | group webdev. Directories beginning with <code>test_</code> also will belong
|
---|
136 | to webdev, but if there is a directory that ends in <code>.new</code> or a file
|
---|
137 | that begins with <code>test_</code> it will be unaffected.</p>
|
---|
138 |
|
---|
139 |
|
---|
140 | <hr>
|
---|
141 | <p align="center">Copyright © 2002-2004 The Apache Software
|
---|
142 | Foundation. All rights Reserved.</p>
|
---|
143 |
|
---|
144 | </body>
|
---|
145 | </html>
|
---|
146 |
|
---|