source: release-kits/lirk3/resources/gs3-release-maker/ant/docs/manual/OptionalTasks/attrib.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 4.0 KB
Line 
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
16directories. Right now it has effect only under Windows. Each of the
174 possible permissions has its own attribute, matching the arguments
18for 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
22href="../CoreTypes/filelist.html">FileList</a>s can be specified using
23nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and
24<code>&lt;filelist&gt;</code> elements.</p>
25
26<p>By default this task will use a single invocation of the underlying
27attrib command. If you are working on a large number of files this
28may result in a command line that is too long for your operating
29system. If you encounter such problems, you should set the
30maxparallel attribute of this task to a non-zero value. The number to
31use highly depends on the length of your file names (the depth of your
32directory 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>&lt;fileset/list&gt;</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>&lt;attrib file=&quot;${dist}/run.bat&quot; readonly=&quot;true&quot; hidden=&quot;true&quot;/&gt;</code></p>
85</blockquote>
86<p>makes the &quot;run.bat&quot; file read-only and hidden.</p>
87<blockquote>
88 <pre>&lt;attrib readonly=&quot;false&quot;&gt;
89 &lt;fileset dir=&quot;${meta.inf}&quot; includes=&quot;**/*.xml&quot;/&gt;
90&lt;attrib&gt;
91</pre>
92</blockquote>
93<p>makes all &quot;.xml&quot; files below <code>${meta.inf}</code> readable.</p>
94<blockquote>
95 <pre>
96&lt;attrib readonly=&quot;true&quot; archive=&quot;true&quot;&gt;
97 &lt;fileset dir=&quot;shared/sources1&quot;&gt;
98 &lt;exclude name=&quot;**/trial/**&quot;/&gt;
99 &lt;/fileset&gt;
100 &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
101&lt;/attrib&gt;
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 &copy; 2002-2004 The Apache Software
110Foundation. All rights Reserved.</p>
111
112</body>
113</html>
114
Note: See TracBrowser for help on using the repository browser.