1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>Ant User Manual</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="attrib">Attrib</a></h2>
|
---|
28 | <p><em>Since Ant 1.6.</em></p>
|
---|
29 | <h3>Description</h3>
|
---|
30 |
|
---|
31 | <p>Changes the attributes of a file or all files inside specified
|
---|
32 | directories. Right now it has effect only under Windows. Each of the
|
---|
33 | 4 possible permissions has its own attribute, matching the arguments
|
---|
34 | for the attrib command.</p>
|
---|
35 |
|
---|
36 | <p><a href="../CoreTypes/fileset.html">FileSet</a>s,
|
---|
37 | <a href="../CoreTypes/dirset.html">DirSet</a>s or <a
|
---|
38 | href="../CoreTypes/filelist.html">FileList</a>s can be specified using
|
---|
39 | nested <code><fileset></code>, <code><dirset></code> and
|
---|
40 | <code><filelist></code> elements.</p>
|
---|
41 |
|
---|
42 | <p>Starting with Ant 1.7, this task supports arbitrary <a
|
---|
43 | href="../CoreTypes/resources.html#collection">Resource Collection</a>s
|
---|
44 | as nested elements.</p>
|
---|
45 |
|
---|
46 | <p>By default this task will use a single invocation of the underlying
|
---|
47 | attrib command. If you are working on a large number of files this
|
---|
48 | may result in a command line that is too long for your operating
|
---|
49 | system. If you encounter such problems, you should set the
|
---|
50 | maxparallel attribute of this task to a non-zero value. The number to
|
---|
51 | use highly depends on the length of your file names (the depth of your
|
---|
52 | directory tree), so you'll have to experiment a little.</p>
|
---|
53 |
|
---|
54 | <h3>Parameters</h3>
|
---|
55 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
56 | <tr>
|
---|
57 | <td valign="top"><b>Attribute</b></td>
|
---|
58 | <td valign="top"><b>Description</b></td>
|
---|
59 | <td align="center" valign="top"><b>Required</b></td>
|
---|
60 | </tr>
|
---|
61 | <tr>
|
---|
62 | <td valign="top">file</td>
|
---|
63 | <td valign="top">the file or directory of which the permissions must be
|
---|
64 | changed.</td>
|
---|
65 | <td valign="top" valign="middle">Yes or nested
|
---|
66 | <code><fileset/list></code> elements.</td>
|
---|
67 | </tr>
|
---|
68 | <tr>
|
---|
69 | <td valign="top">readonly</td>
|
---|
70 | <td valign="top">the readonly permission.</td>
|
---|
71 | <td valign="top" rowspan="4">at least one of the four. </td>
|
---|
72 | </tr>
|
---|
73 | <tr>
|
---|
74 | <td valign="top">archive</td>
|
---|
75 | <td valign="top">the archive permission.</td>
|
---|
76 | </tr>
|
---|
77 | <tr>
|
---|
78 | <td valign="top">system</td>
|
---|
79 | <td valign="top">the system permission.</td>
|
---|
80 | </tr>
|
---|
81 | <tr>
|
---|
82 | <td valign="top">hidden</td>
|
---|
83 | <td valign="top">the hidden permission.</td>
|
---|
84 | </tr>
|
---|
85 | <tr>
|
---|
86 | <td valign="top">type</td>
|
---|
87 | <td valign="top">One of <i>file</i>, <i>dir</i> or <i>both</i>. If set to
|
---|
88 | <i>file</i>, only the permissions of plain files are going to be changed.
|
---|
89 | If set to <i>dir</i>, only the directories are considered.<br>
|
---|
90 | <strong>Note:</strong> The type attribute does not apply to
|
---|
91 | nested <i>dirset</i>s - <i>dirset</i>s always implicitly
|
---|
92 | assume type to be <i>dir</i>.</td>
|
---|
93 | <td align="center" valign="top">No, default is <i>file</i></td>
|
---|
94 | </tr>
|
---|
95 | <tr>
|
---|
96 | <td valign="top">verbose</td>
|
---|
97 | <td valign="top">Whether to print a summary after execution or not.
|
---|
98 | Defaults to <code>false</code>.</td>
|
---|
99 | <td align="center" valign="top">No</td>
|
---|
100 | </tr>
|
---|
101 | <tr>
|
---|
102 | <td valign="top">parallel</td>
|
---|
103 | <td valign="top">process all specified files using a single
|
---|
104 | <code>chmod</code> command. Defaults to true.</td>
|
---|
105 | <td valign="top" align="center">No</td>
|
---|
106 | </tr>
|
---|
107 | <tr>
|
---|
108 | <td valign="top">maxparallel</td>
|
---|
109 | <td valign="top">Limit the amount of parallelism by passing at
|
---|
110 | most this many sourcefiles at once. Set it to <= 0 for
|
---|
111 | unlimited. Defaults to unlimited. <em>Since Ant 1.6.</em></td>
|
---|
112 | <td align="center" valign="top">No</td>
|
---|
113 | </tr>
|
---|
114 | </table>
|
---|
115 | <h3>Examples</h3>
|
---|
116 | <blockquote>
|
---|
117 | <pre><attrib file="${dist}/run.bat" readonly="true" hidden="true"/></pre>
|
---|
118 | </blockquote>
|
---|
119 | <p>makes the "run.bat" file read-only and hidden.</p>
|
---|
120 | <blockquote>
|
---|
121 | <pre><attrib readonly="false">
|
---|
122 | <fileset dir="${meta.inf}" includes="**/*.xml"/>
|
---|
123 | <attrib>
|
---|
124 | </pre>
|
---|
125 | </blockquote>
|
---|
126 | <p>makes all ".xml" files below <code>${meta.inf}</code> readable.</p>
|
---|
127 | <blockquote>
|
---|
128 | <pre>
|
---|
129 | <attrib readonly="true" archive="true">
|
---|
130 | <fileset dir="shared/sources1">
|
---|
131 | <exclude name="**/trial/**"/>
|
---|
132 | </fileset>
|
---|
133 | <fileset refid="other.shared.sources"/>
|
---|
134 | </attrib>
|
---|
135 | </pre>
|
---|
136 | </blockquote>
|
---|
137 | <p>makes all files below <code>shared/sources1</code> (except those below any
|
---|
138 | directory named trial) read-only and archived. In addition all files belonging
|
---|
139 | to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
|
---|
140 | same attributes.</p>
|
---|
141 |
|
---|
142 |
|
---|
143 | </body>
|
---|
144 | </html>
|
---|
145 |
|
---|