[19253] | 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 | <h3>Parameters</h3>
|
---|
| 27 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
| 28 | <tr>
|
---|
| 29 | <td valign="top"><b>Attribute</b></td>
|
---|
| 30 | <td valign="top"><b>Description</b></td>
|
---|
| 31 | <td align="center" valign="top"><b>Required</b></td>
|
---|
| 32 | </tr>
|
---|
| 33 | <tr>
|
---|
| 34 | <td valign="top">file</td>
|
---|
| 35 | <td valign="top">the file or directory of which the permissions must be
|
---|
| 36 | changed.</td>
|
---|
| 37 | <td valign="top" valign="middle">Yes or nested
|
---|
| 38 | <code><fileset/list></code> elements.</td>
|
---|
| 39 | </tr>
|
---|
| 40 | <tr>
|
---|
| 41 | <td valign="top">readonly</td>
|
---|
| 42 | <td valign="top">the readonly permission.</td>
|
---|
| 43 | <td valign="top" rowspan="4">at least one of the four. </td>
|
---|
| 44 | </tr>
|
---|
| 45 | <tr>
|
---|
| 46 | <td valign="top">archive</td>
|
---|
| 47 | <td valign="top">the archive permission.</td>
|
---|
| 48 | </tr>
|
---|
| 49 | <tr>
|
---|
| 50 | <td valign="top">system</td>
|
---|
| 51 | <td valign="top">the system permission.</td>
|
---|
| 52 | </tr>
|
---|
| 53 | <tr>
|
---|
| 54 | <td valign="top">hidden</td>
|
---|
| 55 | <td valign="top">the hidden permission.</td>
|
---|
| 56 | </tr>
|
---|
| 57 | <tr>
|
---|
| 58 | <td valign="top">type</td>
|
---|
| 59 | <td valign="top">One of <i>file</i>, <i>dir</i> or <i>both</i>. If set to
|
---|
| 60 | <i>file</i>, only the permissions of plain files are going to be changed.
|
---|
| 61 | If set to <i>dir</i>, only the directories are considered.<br>
|
---|
| 62 | <strong>Note:</strong> The type attribute does not apply to
|
---|
| 63 | nested <i>dirset</i>s - <i>dirset</i>s always implicitly
|
---|
| 64 | assume type to be <i>dir</i>.</td>
|
---|
| 65 | <td align="center" valign="top">No, default is <i>file</i></td>
|
---|
| 66 | </tr>
|
---|
| 67 | <tr>
|
---|
| 68 | <td valign="top">verbose</td>
|
---|
| 69 | <td valign="top">Whether to print a summary after execution or not.
|
---|
| 70 | Defaults to <code>false</code>.</td>
|
---|
| 71 | <td align="center" valign="top">No</td>
|
---|
| 72 | </tr>
|
---|
| 73 | </table>
|
---|
| 74 | <h3>Examples</h3>
|
---|
| 75 | <blockquote>
|
---|
| 76 | <p><code><attrib file="${dist}/run.bat" readonly="true" hidden="true"/></code></p>
|
---|
| 77 | </blockquote>
|
---|
| 78 | <p>makes the "run.bat" file read-only and hidden.</p>
|
---|
| 79 | <blockquote>
|
---|
| 80 | <pre><attrib readonly="false">
|
---|
| 81 | <fileset dir="${meta.inf}" includes="**/*.xml"/>
|
---|
| 82 | <attrib>
|
---|
| 83 | </pre>
|
---|
| 84 | </blockquote>
|
---|
| 85 | <p>makes all ".xml" files below <code>${meta.inf}</code> readable.</p>
|
---|
| 86 | <blockquote>
|
---|
| 87 | <pre>
|
---|
| 88 | <attrib readonly="true" archive="true">
|
---|
| 89 | <fileset dir="shared/sources1">
|
---|
| 90 | <exclude name="**/trial/**"/>
|
---|
| 91 | </fileset>
|
---|
| 92 | <fileset refid="other.shared.sources"/>
|
---|
| 93 | </attrib>
|
---|
| 94 | </pre>
|
---|
| 95 | </blockquote>
|
---|
| 96 | <p>makes all files below <code>shared/sources1</code> (except those below any
|
---|
| 97 | directory named trial) read-only and archived. In addition all files belonging
|
---|
| 98 | to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
|
---|
| 99 | same attributes.</p>
|
---|
| 100 | <hr>
|
---|
| 101 | <p align="center">Copyright © 2002-2004 The Apache Software
|
---|
| 102 | Foundation. All rights Reserved.</p>
|
---|
| 103 |
|
---|
| 104 | </body>
|
---|
| 105 | </html>
|
---|
| 106 |
|
---|