source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.6.2/manual/OptionalTasks/chown.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 4.3 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Chown Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="Chown">Chown</a></h2>
12<p><em>Since Ant 1.6.</em></p>
13<h3>Description</h3>
14
15<p>Changes the owner of a file or all files inside specified
16directories. Right now it has effect only under Unix. The owner
17atribute is equivalent to the coresponding argument for the chown
18command.</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
27<h3>Parameters</h3>
28<table border="1" cellpadding="2" cellspacing="0">
29 <tr>
30 <td valign="top"><b>Attribute</b></td>
31 <td valign="top"><b>Description</b></td>
32 <td align="center" valign="top"><b>Required</b></td>
33 </tr>
34 <tr>
35 <td valign="top">file</td>
36 <td valign="top">the file or directory of which the owner must be
37 changed.</td>
38 <td valign="top" valign="middle">Yes or nested
39 <code>&lt;fileset/list&gt;</code> elements.</td>
40 </tr>
41 <tr>
42 <td valign="top">owner</td>
43 <td valign="top">the new owner.</td>
44 <td valign="top" align="center">Yes</td>
45 </tr>
46 <tr>
47 <td valign="top">parallel</td>
48 <td valign="top">process all specified files using a single
49 <code>chown</code> command. Defaults to true.</td>
50 <td valign="top" align="center">No</td>
51 </tr>
52 <tr>
53 <td valign="top">type</td>
54 <td valign="top">One of <i>file</i>, <i>dir</i> or
55 <i>both</i>. If set to <i>file</i>, only the owner of
56 plain files are going to be changed. If set to <i>dir</i>, only
57 the directories are considered.<br>
58 <strong>Note:</strong> The type attribute does not apply to
59 nested <i>dirset</i>s - <i>dirset</i>s always implicitly
60 assume type to be <i>dir</i>.</td>
61 <td align="center" valign="top">No, default is <i>file</i></td>
62 </tr>
63 <tr>
64 <td valign="top">maxparallel</td>
65 <td valign="top">Limit the amount of parallelism by passing at
66 most this many sourcefiles at once. Set it to &lt;= 0 for
67 unlimited. Defaults to unlimited.</td>
68 <td align="center" valign="top">No</td>
69
70 </tr>
71 <tr>
72 <td valign="top">verbose</td>
73 <td valign="top">Whether to print a summary after execution or not.
74 Defaults to <code>false</code>.</td>
75 <td align="center" valign="top">No</td>
76 </tr>
77
78</table>
79<h3>Examples</h3>
80<blockquote>
81 <p><code>&lt;chown file=&quot;${dist}/start.sh&quot; owner=&quot;coderjoe&quot;/&gt;</code></p>
82</blockquote>
83<p>makes the &quot;start.sh&quot; file belong to coderjoe on a
84UNIX system.</p>
85<blockquote>
86<pre>
87 &lt;chown owner=&quot;coderjoe&quot;&gt;
88 &lt;fileset dir=&quot;${dist}/bin&quot; includes=&quot;**/*.sh&quot;/&gt;
89 &lt;/chown&gt;
90</pre>
91</blockquote>
92<p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
93belong to coderjoe on a UNIX system.</p>
94<blockquote>
95<pre>
96&lt;chown owner=&quot;coderjoe&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;/chown&gt;
102</pre>
103</blockquote>
104<p>makes all files below <code>shared/sources1</code> (except those
105below any directory named trial) belong to coderjoe on a UNIX
106system. In addition all files belonging to a FileSet
107with <code>id</code> <code>other.shared.sources</code> get the same
108owner.</p>
109
110<blockquote>
111<pre>
112&lt;chown owner=&quot;webadmin&quot; type=&quot;file&quot;&gt;
113 &lt;fileset dir=&quot;/web&quot;&gt;
114 &lt;include name=&quot;**/*.cgi&quot;/&gt;
115 &lt;include name=&quot;**/*.old&quot;/&gt;
116 &lt;/fileset&gt;
117 &lt;dirset dir=&quot;/web&quot;&gt;
118 &lt;include name=&quot;**/private_*&quot;/&gt;
119 &lt;/dirset&gt;
120&lt;/chmod&gt;
121</pre>
122</blockquote>
123
124<p>makes cgi scripts, files with a <code>.old</code> extension or
125directories begining with <code>private_</code> belong to the user named
126webadmin. A directory ending in <code>.old</code> or a file begining with
127<code>private_</code> would remain unaffected.</p>
128
129<hr>
130<p align="center">Copyright &copy; 2002-2004 The Apache Software
131Foundation. All rights Reserved.</p>
132
133</body>
134</html>
135
Note: See TracBrowser for help on using the repository browser.