2018-12-21 11:20:43 +01:00
|
|
|
<!DOCTYPE html>
|
2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
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
|
|
|
|
|
2019-05-25 13:41:47 +02:00
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
2006-09-11 04:19:00 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
-->
|
2018-12-21 11:20:43 +01:00
|
|
|
<html lang="en">
|
2002-11-07 15:59:47 +00:00
|
|
|
|
|
|
|
<head>
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2002-11-07 15:59:47 +00:00
|
|
|
<title>Chgrp Task</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<h2 id="chgrp">Chgrp</h2>
|
2018-01-24 21:40:28 +01:00
|
|
|
<p><em>Since Apache Ant 1.6</em>.</p>
|
2002-11-07 15:59:47 +00:00
|
|
|
<h3>Description</h3>
|
|
|
|
|
2018-02-28 07:58:59 +01:00
|
|
|
<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
|
2018-03-10 20:17:33 +01:00
|
|
|
the <kbd>chgrp</kbd> command.</p>
|
2018-02-28 07:58:59 +01:00
|
|
|
|
|
|
|
<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><em>Since Ant 1.7</em>, this task supports
|
2018-03-05 17:35:30 +01:00
|
|
|
arbitrary <a href="../Types/resources.html#collection">resource collections</a> as nested
|
2018-02-28 07:58:59 +01:00
|
|
|
elements.</p>
|
|
|
|
|
2018-03-10 20:17:33 +01:00
|
|
|
<p>By default this task will use a single invocation of the underlying <kbd>chgrp</kbd> command.
|
2018-02-28 07:58:59 +01:00
|
|
|
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 <var>maxparallel</var>
|
|
|
|
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
|
2018-03-10 20:17:33 +01:00
|
|
|
know for sure that you have a <kbd>chgrp</kbd> executable on your <code>PATH</code> that is
|
2018-02-28 07:58:59 +01:00
|
|
|
command line compatible with the Unix command, you can use the task's <var>os</var> attribute and
|
|
|
|
set its value to your current OS.</p>
|
2008-11-14 15:12:26 +00:00
|
|
|
|
2002-11-07 15:59:47 +00:00
|
|
|
<h3>Parameters</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<table class="attr">
|
2002-11-07 15:59:47 +00:00
|
|
|
<tr>
|
2018-05-15 10:29:27 +02:00
|
|
|
<th scope="col">Attribute</th>
|
|
|
|
<th scope="col">Description</th>
|
|
|
|
<th scope="col">Required</th>
|
2002-11-07 15:59:47 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>file</td>
|
|
|
|
<td>the file or directory of which the group must be changed.</td>
|
|
|
|
<td>Yes, unless nested <code><fileset|filelist|dirset></code> elements are specified</td>
|
2002-11-07 15:59:47 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>group</td>
|
|
|
|
<td>the new group.</td>
|
|
|
|
<td>Yes</td>
|
2002-11-07 15:59:47 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>parallel</td>
|
2018-03-10 20:17:33 +01:00
|
|
|
<td>process all specified files using a single <kbd>chgrp</kbd> command.</td>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>No; defaults to <q>true</q></td>
|
2002-11-07 15:59:47 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>type</td>
|
|
|
|
<td>One of <q>file</q>, <q>dir</q> or <q>both</q>. If set to <q>file</q>, only the group of
|
|
|
|
plain files are going to be changed. If set to <q>dir</q>, only the directories are
|
|
|
|
considered.<br/><strong>Note</strong>: The type attribute does not apply to
|
|
|
|
nested <code>dirset</code>s—<code>dirset</code>s always implicitly assume type to
|
|
|
|
be <q>dir</q>.</td>
|
|
|
|
<td>No; default is <q>file</q></td>
|
2002-11-07 15:59:47 +00:00
|
|
|
</tr>
|
2003-05-21 08:55:35 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>maxparallel</td>
|
|
|
|
<td>Limit the amount of parallelism by passing at most this many sourcefiles at once. Set it to
|
|
|
|
negative integer for unlimited.</td>
|
|
|
|
<td>No; defaults to unlimited</td>
|
2003-05-21 08:55:35 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>verbose</td>
|
|
|
|
<td>Whether to print a summary after execution or not.</td>
|
|
|
|
<td>No; defaults to <q>false</q></td>
|
2003-05-21 08:55:35 +00:00
|
|
|
</tr>
|
2008-11-14 15:12:26 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>os</td>
|
|
|
|
<td>list of Operating Systems on which the command may be executed.</td>
|
|
|
|
<td>No</td>
|
2008-11-14 15:12:26 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>osfamily</td>
|
|
|
|
<td>OS family as used in the <a href="../Tasks/conditions.html#os"><os></a>
|
2008-11-14 15:12:26 +00:00
|
|
|
condition.</td>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>No; defaults to <q>unix</q></td>
|
2008-11-14 15:12:26 +00:00
|
|
|
</tr>
|
2002-11-07 15:59:47 +00:00
|
|
|
</table>
|
|
|
|
<h3>Examples</h3>
|
2018-02-09 06:54:03 +01:00
|
|
|
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>Make the <samp>start.sh</samp> file belong to the <samp>coders</samp> group on a UNIX system.</p>
|
|
|
|
<pre><chgrp file="${dist}/start.sh" group="coders"/></pre>
|
2018-02-09 06:54:03 +01:00
|
|
|
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>Make all <samp>.sh</samp> files below <samp>${dist}/bin</samp> belong to the <samp>coders</samp>
|
|
|
|
group on a UNIX system.</p>
|
2002-11-07 15:59:47 +00:00
|
|
|
<pre>
|
2003-06-24 09:16:10 +00:00
|
|
|
<chgrp group="coders">
|
|
|
|
<fileset dir="${dist}/bin" includes="**/*.sh"/>
|
2018-02-28 07:58:59 +01:00
|
|
|
</chgrp></pre>
|
2018-02-09 06:54:03 +01:00
|
|
|
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>Make all files below <samp>shared/sources1</samp> (except those below any directory
|
|
|
|
named <samp>trial</samp>) belong to the <samp>coders</samp> group on a UNIX system. In addition, all
|
|
|
|
files belonging to a FileSet with <var>id</var>=<samp>other.shared.sources</samp> get the same
|
|
|
|
group.</p>
|
2002-11-07 15:59:47 +00:00
|
|
|
<pre>
|
|
|
|
<chgrp group="coders">
|
|
|
|
<fileset dir="shared/sources1">
|
|
|
|
<exclude name="**/trial/**"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset refid="other.shared.sources"/>
|
|
|
|
</chgrp>
|
|
|
|
</pre>
|
2018-02-09 06:54:03 +01:00
|
|
|
|
2018-05-15 09:51:58 +02:00
|
|
|
<p>Make all <samp>.test.jsp</samp>, and <samp>.new</samp> files belong to
|
|
|
|
group <samp>webdev</samp>. Directories with names beginning with <samp>test_</samp> also will belong
|
|
|
|
to <samp>webdev</samp>, but if there is a directory name that ends in <samp>.new</samp> or a file
|
|
|
|
name that begins with <samp>test_</samp> it will be unaffected.</p>
|
2003-06-24 09:16:10 +00:00
|
|
|
<pre>
|
|
|
|
<chgrp group="webdev" type="file">
|
|
|
|
<fileset dir="/web">
|
|
|
|
<include name="**/*.test.jsp"/>
|
|
|
|
<include name="**/*.new"/>
|
|
|
|
</fileset>
|
|
|
|
<dirset dir="/web">
|
|
|
|
<include name="**/test_*"/>
|
|
|
|
</dirset>
|
2018-02-28 07:58:59 +01:00
|
|
|
</chmod></pre>
|
2003-06-24 09:16:10 +00:00
|
|
|
|
2002-11-07 15:59:47 +00:00
|
|
|
</body>
|
|
|
|
</html>
|