1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>Ant User Manual</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="attrib">Attrib</a></h2>
|
---|
12 | <p><em>Since Ant 1.6.</em></p>
|
---|
13 | <h3>Description</h3>
|
---|
14 |
|
---|
15 | <p>Changes the attributes of a file or all files inside specified
|
---|
16 | directories. Right now it has effect only under Windows. Each of the
|
---|
17 | 4 possible permissions has its own attribute, matching the arguments
|
---|
18 | for the attrib 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 | attrib command. If you are working on a large number of files this
|
---|
28 | may result in a command line that is too long for your operating
|
---|
29 | system. If you encounter such problems, you should set the
|
---|
30 | maxparallel attribute of this task to a non-zero value. The number to
|
---|
31 | use highly depends on the length of your file names (the depth of your
|
---|
32 | directory tree), so you'll have to experiment a little.</p>
|
---|
33 |
|
---|
34 | <h3>Parameters</h3>
|
---|
35 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
36 | <tr>
|
---|
37 | <td valign="top"><b>Attribute</b></td>
|
---|
38 | <td valign="top"><b>Description</b></td>
|
---|
39 | <td align="center" valign="top"><b>Required</b></td>
|
---|
40 | </tr>
|
---|
41 | <tr>
|
---|
42 | <td valign="top">file</td>
|
---|
43 | <td valign="top">the file or directory of which the permissions must be
|
---|
44 | changed.</td>
|
---|
45 | <td valign="top" valign="middle">Yes or nested
|
---|
46 | <code><fileset/list></code> elements.</td>
|
---|
47 | </tr>
|
---|
48 | <tr>
|
---|
49 | <td valign="top">readonly</td>
|
---|
50 | <td valign="top">the readonly permission.</td>
|
---|
51 | <td valign="top" rowspan="4">at least one of the four. </td>
|
---|
52 | </tr>
|
---|
53 | <tr>
|
---|
54 | <td valign="top">archive</td>
|
---|
55 | <td valign="top">the archive permission.</td>
|
---|
56 | </tr>
|
---|
57 | <tr>
|
---|
58 | <td valign="top">system</td>
|
---|
59 | <td valign="top">the system permission.</td>
|
---|
60 | </tr>
|
---|
61 | <tr>
|
---|
62 | <td valign="top">hidden</td>
|
---|
63 | <td valign="top">the hidden permission.</td>
|
---|
64 | </tr>
|
---|
65 | <tr>
|
---|
66 | <td valign="top">type</td>
|
---|
67 | <td valign="top">One of <i>file</i>, <i>dir</i> or <i>both</i>. If set to
|
---|
68 | <i>file</i>, only the permissions of plain files are going to be changed.
|
---|
69 | If set to <i>dir</i>, only the directories are considered.<br>
|
---|
70 | <strong>Note:</strong> The type attribute does not apply to
|
---|
71 | nested <i>dirset</i>s - <i>dirset</i>s always implicitly
|
---|
72 | assume type to be <i>dir</i>.</td>
|
---|
73 | <td align="center" valign="top">No, default is <i>file</i></td>
|
---|
74 | </tr>
|
---|
75 | <tr>
|
---|
76 | <td valign="top">verbose</td>
|
---|
77 | <td valign="top">Whether to print a summary after execution or not.
|
---|
78 | Defaults to <code>false</code>.</td>
|
---|
79 | <td align="center" valign="top">No</td>
|
---|
80 | </tr>
|
---|
81 | </table>
|
---|
82 | <h3>Examples</h3>
|
---|
83 | <blockquote>
|
---|
84 | <p><code><attrib file="${dist}/run.bat" readonly="true" hidden="true"/></code></p>
|
---|
85 | </blockquote>
|
---|
86 | <p>makes the "run.bat" file read-only and hidden.</p>
|
---|
87 | <blockquote>
|
---|
88 | <pre><attrib readonly="false">
|
---|
89 | <fileset dir="${meta.inf}" includes="**/*.xml"/>
|
---|
90 | <attrib>
|
---|
91 | </pre>
|
---|
92 | </blockquote>
|
---|
93 | <p>makes all ".xml" files below <code>${meta.inf}</code> readable.</p>
|
---|
94 | <blockquote>
|
---|
95 | <pre>
|
---|
96 | <attrib readonly="true" archive="true">
|
---|
97 | <fileset dir="shared/sources1">
|
---|
98 | <exclude name="**/trial/**"/>
|
---|
99 | </fileset>
|
---|
100 | <fileset refid="other.shared.sources"/>
|
---|
101 | </attrib>
|
---|
102 | </pre>
|
---|
103 | </blockquote>
|
---|
104 | <p>makes all files below <code>shared/sources1</code> (except those below any
|
---|
105 | directory named trial) read-only and archived. In addition all files belonging
|
---|
106 | to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
|
---|
107 | same attributes.</p>
|
---|
108 | <hr>
|
---|
109 | <p align="center">Copyright © 2002-2004 The Apache Software
|
---|
110 | Foundation. All rights Reserved.</p>
|
---|
111 |
|
---|
112 | </body>
|
---|
113 | </html>
|
---|
114 |
|
---|