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
|
|
|
|
|
|
|
|
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.
|
|
|
|
-->
|
2002-11-07 15:59:47 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
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>Chown Task</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2><a name="Chown">Chown</a></h2>
|
2003-05-21 08:55:35 +00:00
|
|
|
<p><em>Since Ant 1.6.</em></p>
|
2002-11-07 15:59:47 +00:00
|
|
|
<h3>Description</h3>
|
|
|
|
|
|
|
|
<p>Changes the owner of a file or all files inside specified
|
|
|
|
directories. Right now it has effect only under Unix. The owner
|
2004-11-12 10:36:29 +00:00
|
|
|
attribute is equivalent to the corresponding argument for the chown
|
2002-11-07 15:59:47 +00:00
|
|
|
command.</p>
|
|
|
|
|
2003-06-24 09:16:10 +00:00
|
|
|
<p><a href="../CoreTypes/fileset.html">FileSet</a>s,
|
|
|
|
<a href="../CoreTypes/dirset.html">DirSet</a>s or <a
|
2003-05-21 08:55:35 +00:00
|
|
|
href="../CoreTypes/filelist.html">FileList</a>s can be specified using
|
2003-06-24 09:16:10 +00:00
|
|
|
nested <code><fileset></code>, <code><dirset></code> and
|
|
|
|
<code><filelist></code> elements.</p>
|
|
|
|
|
2005-09-28 18:48:41 +00:00
|
|
|
<p>Starting with Ant 1.7, this task supports arbitrary <a
|
|
|
|
href="../CoreTypes/resources.html#collection">Resource Collection</a>s
|
|
|
|
as nested elements.</p>
|
2002-11-07 15:59:47 +00:00
|
|
|
|
2005-03-22 11:11:48 +00:00
|
|
|
<p>By default this task will use a single invocation of the underlying
|
|
|
|
chown 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>
|
|
|
|
|
2002-11-07 15:59:47 +00:00
|
|
|
<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>
|
2002-11-08 08:32:13 +00:00
|
|
|
<td valign="top">the file or directory of which the owner must be
|
|
|
|
changed.</td>
|
|
|
|
<td valign="top" valign="middle">Yes or nested
|
2003-05-21 08:55:35 +00:00
|
|
|
<code><fileset/list></code> elements.</td>
|
2002-11-07 15:59:47 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">owner</td>
|
|
|
|
<td valign="top">the new owner.</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>chown</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 owner of
|
|
|
|
plain files are going to be changed. If set to <i>dir</i>, only
|
2003-06-24 09:16:10 +00:00
|
|
|
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>
|
2002-11-07 15:59:47 +00:00
|
|
|
<td align="center" valign="top">No, default is <i>file</i></td>
|
|
|
|
</tr>
|
2003-05-21 08:55:35 +00:00
|
|
|
<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>
|
|
|
|
|
2002-11-07 15:59:47 +00:00
|
|
|
</table>
|
|
|
|
<h3>Examples</h3>
|
2005-03-11 09:42:56 +00:00
|
|
|
<blockquote><pre>
|
|
|
|
<chown file="${dist}/start.sh" owner="coderjoe"/>
|
|
|
|
</pre>
|
2002-11-07 15:59:47 +00:00
|
|
|
</blockquote>
|
2005-03-11 09:42:56 +00:00
|
|
|
<p>makes the "start.sh" file belong to coderjoe on a
|
2002-11-07 15:59:47 +00:00
|
|
|
UNIX system.</p>
|
|
|
|
<blockquote>
|
|
|
|
<pre>
|
2005-03-11 09:42:56 +00:00
|
|
|
<chown owner="coderjoe">
|
|
|
|
<fileset dir="${dist}/bin" includes="**/*.sh"/>
|
2002-11-07 15:59:47 +00:00
|
|
|
</chown>
|
|
|
|
</pre>
|
|
|
|
</blockquote>
|
2005-03-11 09:42:56 +00:00
|
|
|
<p>makes all ".sh" files below <code>${dist}/bin</code>
|
2002-11-07 15:59:47 +00:00
|
|
|
belong to coderjoe on a UNIX system.</p>
|
|
|
|
<blockquote>
|
|
|
|
<pre>
|
2005-03-11 09:42:56 +00:00
|
|
|
<chown owner="coderjoe">
|
|
|
|
<fileset dir="shared/sources1">
|
|
|
|
<exclude name="**/trial/**"/>
|
2002-11-07 15:59:47 +00:00
|
|
|
</fileset>
|
2005-03-11 09:42:56 +00:00
|
|
|
<fileset refid="other.shared.sources"/>
|
2002-11-07 15:59:47 +00:00
|
|
|
</chown>
|
|
|
|
</pre>
|
|
|
|
</blockquote>
|
|
|
|
<p>makes all files below <code>shared/sources1</code> (except those
|
|
|
|
below any directory named trial) belong to coderjoe on a UNIX
|
|
|
|
system. In addition all files belonging to a FileSet
|
|
|
|
with <code>id</code> <code>other.shared.sources</code> get the same
|
|
|
|
owner.</p>
|
2003-06-24 09:16:10 +00:00
|
|
|
|
|
|
|
<blockquote>
|
|
|
|
<pre>
|
2005-03-11 09:42:56 +00:00
|
|
|
<chown owner="webadmin" type="file">
|
|
|
|
<fileset dir="/web">
|
|
|
|
<include name="**/*.cgi"/>
|
|
|
|
<include name="**/*.old"/>
|
2003-06-24 09:16:10 +00:00
|
|
|
</fileset>
|
2005-03-11 09:42:56 +00:00
|
|
|
<dirset dir="/web">
|
|
|
|
<include name="**/private_*"/>
|
2003-06-24 09:16:10 +00:00
|
|
|
</dirset>
|
|
|
|
</chmod>
|
|
|
|
</pre>
|
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
<p>makes cgi scripts, files with a <code>.old</code> extension or
|
2004-11-12 10:36:29 +00:00
|
|
|
directories beginning with <code>private_</code> belong to the user named
|
|
|
|
webadmin. A directory ending in <code>.old</code> or a file beginning with
|
2003-06-24 09:16:10 +00:00
|
|
|
<code>private_</code> would remain unaffected.</p>
|
|
|
|
|
2006-09-11 20:22:51 +00:00
|
|
|
|
2002-11-07 15:59:47 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|