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 16:26:18 +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">
|
2010-11-11 17:04:16 +00:00
|
|
|
<title>Apache Ant User Manual</title>
|
2002-11-07 16:26:18 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<h2 id="attrib">Attrib</h2>
|
2010-11-11 17:04:16 +00:00
|
|
|
<p><em>Since Apache Ant 1.6.</em></p>
|
2002-11-07 16:26:18 +00:00
|
|
|
<h3>Description</h3>
|
|
|
|
|
|
|
|
<p>Changes the attributes of a file or all files inside specified
|
|
|
|
directories. Right now it has effect only under Windows. Each of the
|
|
|
|
4 possible permissions has its own attribute, matching the arguments
|
|
|
|
for the attrib command.</p>
|
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<p><a href="../Types/fileset.html">FileSet</a>s,
|
2010-05-26 20:33:51 +00:00
|
|
|
<a href="../Types/dirset.html">DirSet</a>s or <a
|
|
|
|
href="../Types/filelist.html">FileList</a>s can be specified using
|
2018-01-22 23:52:21 +01:00
|
|
|
nested <code><fileset></code>, <code><dirset></code> and
|
2003-06-24 09:16:10 +00:00
|
|
|
<code><filelist></code> elements.</p>
|
2002-11-07 16:26:18 +00:00
|
|
|
|
2005-09-28 18:48:41 +00:00
|
|
|
<p>Starting with Ant 1.7, this task supports arbitrary <a
|
2010-05-26 20:33:51 +00:00
|
|
|
href="../Types/resources.html#collection">Resource Collection</a>s
|
2005-09-28 18:48:41 +00:00
|
|
|
as nested elements.</p>
|
|
|
|
|
2010-06-17 12:39:27 +00:00
|
|
|
<!--p>By default this task will use a single invocation of the underlying
|
2005-03-22 11:11:48 +00:00
|
|
|
attrib 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
|
2010-06-17 12:39:27 +00:00
|
|
|
directory tree), so you'll have to experiment a little.</p-->
|
2005-03-22 11:11:48 +00:00
|
|
|
|
2008-11-14 15:12:26 +00:00
|
|
|
<p>By default this task won't do anything unless it detects it is
|
|
|
|
running on a Windows system. If you know for sure that you have a
|
|
|
|
"attrib" executable on your PATH that is command line compatible with
|
|
|
|
the Windows command, you can use the task's os attribute and set its
|
|
|
|
value to your current os.</p>
|
|
|
|
|
2016-04-17 17:30:07 +02:00
|
|
|
<p>See the <a href="setpermissions.html">setpermissions</a> task for a
|
|
|
|
platform independent alternative.</p>
|
|
|
|
|
2002-11-07 16:26:18 +00:00
|
|
|
<h3>Parameters</h3>
|
2018-01-22 23:52:21 +01:00
|
|
|
<table>
|
2002-11-07 16:26:18 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
2018-01-22 23:52:21 +01:00
|
|
|
<td valign="top" align="center"><b>Required</b></td>
|
2002-11-07 16:26:18 +00:00
|
|
|
</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 permissions must be
|
2002-11-07 16:26:18 +00:00
|
|
|
changed.</td>
|
2018-01-22 23:52:21 +01:00
|
|
|
<td valign="top" align="center">Yes or nested
|
2003-05-21 08:55:35 +00:00
|
|
|
<code><fileset/list></code> elements.</td>
|
2002-11-07 16:26:18 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">readonly</td>
|
|
|
|
<td valign="top">the readonly permission.</td>
|
2018-01-22 23:52:21 +01:00
|
|
|
<td valign="top" rowspan="4">at least one of the four.</td>
|
2002-11-07 16:26:18 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">archive</td>
|
|
|
|
<td valign="top">the archive permission.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">system</td>
|
|
|
|
<td valign="top">the system permission.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">hidden</td>
|
|
|
|
<td valign="top">the hidden permission.</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 permissions of plain files are going to be changed.
|
2003-06-24 09:16:10 +00:00
|
|
|
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>
|
2002-11-07 16:26:18 +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">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>
|
2010-06-17 12:39:27 +00:00
|
|
|
<!--tr>
|
2005-11-16 19:40:28 +00:00
|
|
|
<td valign="top">parallel</td>
|
|
|
|
<td valign="top">process all specified files using a single
|
|
|
|
<code>chmod</code> command. Defaults to true.</td>
|
|
|
|
<td valign="top" align="center">No</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. <em>Since Ant 1.6.</em></td>
|
|
|
|
<td align="center" valign="top">No</td>
|
2010-06-17 12:39:27 +00:00
|
|
|
</tr-->
|
2008-11-14 15:12:26 +00:00
|
|
|
<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
|
2010-05-26 20:33:51 +00:00
|
|
|
the <a href="../Tasks/conditions.html#os"><os></a>
|
2008-11-14 15:12:26 +00:00
|
|
|
condition.</td>
|
|
|
|
<td align="center" valign="top">No - defaults to "windows"</td>
|
|
|
|
</tr>
|
2002-11-07 16:26:18 +00:00
|
|
|
</table>
|
2008-02-27 11:48:02 +00:00
|
|
|
|
2002-11-07 16:26:18 +00:00
|
|
|
<h3>Examples</h3>
|
2005-03-11 09:42:56 +00:00
|
|
|
<blockquote>
|
|
|
|
<pre><attrib file="${dist}/run.bat" readonly="true" hidden="true"/></pre>
|
2002-11-07 16:26:18 +00:00
|
|
|
</blockquote>
|
|
|
|
<p>makes the "run.bat" file read-only and hidden.</p>
|
2008-02-27 11:48:02 +00:00
|
|
|
|
2002-11-07 16:26:18 +00:00
|
|
|
<blockquote>
|
|
|
|
<pre><attrib readonly="false">
|
|
|
|
<fileset dir="${meta.inf}" includes="**/*.xml"/>
|
2008-02-27 11:48:02 +00:00
|
|
|
</attrib>
|
2002-11-07 16:26:18 +00:00
|
|
|
</pre>
|
|
|
|
</blockquote>
|
|
|
|
<p>makes all ".xml" files below <code>${meta.inf}</code> readable.</p>
|
2008-02-27 11:48:02 +00:00
|
|
|
|
2002-11-07 16:26:18 +00:00
|
|
|
<blockquote>
|
|
|
|
<pre>
|
|
|
|
<attrib readonly="true" archive="true">
|
|
|
|
<fileset dir="shared/sources1">
|
|
|
|
<exclude name="**/trial/**"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset refid="other.shared.sources"/>
|
|
|
|
</attrib>
|
|
|
|
</pre>
|
|
|
|
</blockquote>
|
|
|
|
<p>makes all files below <code>shared/sources1</code> (except those below any
|
|
|
|
directory named trial) read-only and archived. In addition all files belonging
|
|
|
|
to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
|
|
|
|
same attributes.</p>
|
2006-09-11 20:22:51 +00:00
|
|
|
|
2002-11-07 16:26:18 +00:00
|
|
|
</body>
|
|
|
|
</html>
|