4
<meta http-equiv="Content-Language" content="en-us">
5
<title>Ant User Manual</title>
10
<h2><a name="chmod">Chmod</a></h2>
12
<p>Changes the permissions of a file or all files inside specified directories. Right now it has effect only under Unix.
13
The permissions are also UNIX style, like the argument for the chmod command.</p>
14
<p>See the section on <a href="../dirtasks.html#directorybasedtasks">directory based
15
tasks</a>, on how the inclusion/exclusion of files works, and how to
17
<p>This task holds an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
18
supports all of FileSet's attributes and nested elements
19
directly. More FileSets can be specified using nested
20
<code><fileset></code> elements.</p>
22
<table border="1" cellpadding="2" cellspacing="0">
24
<td valign="top"><b>Attribute</b></td>
25
<td valign="top"><b>Description</b></td>
26
<td align="center" valign="top"><b>Required</b></td>
29
<td valign="top">file</td>
30
<td valign="top">the file or single directory of which the permissions
32
<td valign="top" valign="middle" rowspan="2">exactly one of the two or nested <code><fileset></code> elements.</td>
35
<td valign="top">dir</td>
36
<td valign="top">the directory which holds the files whose permissions
40
<td valign="top">perm</td>
41
<td valign="top">the new permissions.</td>
42
<td valign="top" align="center">Yes</td>
45
<td valign="top">includes</td>
46
<td valign="top">comma separated list of patterns of files that must be
48
<td valign="top" align="center">No</td>
51
<td valign="top">includesfile</td>
52
<td valign="top">the name of a file. Each line of this file is
53
taken to be an include pattern</td>
54
<td valign="top" align="center">No</td>
57
<td valign="top">excludes</td>
58
<td valign="top">comma separated list of patterns of files that must be
59
excluded. No files (except default excludes) are excluded when omitted.</td>
60
<td valign="top" align="center">No</td>
63
<td valign="top">excludesfile</td>
64
<td valign="top">the name of a file. Each line of this file is
65
taken to be an exclude pattern</td>
66
<td valign="top" align="center">No</td>
69
<td valign="top">defaultexcludes</td>
70
<td valign="top">indicates whether default excludes should be used or not
71
("yes"/"no"). Default excludes are used when omitted.</td>
72
<td valign="top" align="center">No</td>
75
<td valign="top">parallel</td>
76
<td valign="top">process all specified files using a single
77
<code>chmod</code> command. Defaults to true.</td>
78
<td valign="top" align="center">No</td>
81
<td valign="top">type</td>
82
<td valign="top">One of <i>file</i>, <i>dir</i> or
83
<i>both</i>. If set to <i>file</i>, only the permissions of
84
plain files are going to be changed. If set to <i>dir</i>, only
85
the directories are considered.</td>
86
<td align="center" valign="top">No, default is <i>file</i></td>
91
<p><code><chmod file="${dist}/start.sh" perm="ugo+rx"/></code></p>
93
<p>makes the "start.sh" file readable and executable for anyone on a
97
<chmod dir="${dist}/bin" perm="ugo+rx" includes="**/*.sh"/>
100
<p>makes all ".sh" files below <code>${dist}/bin</code>
101
readable and executable for anyone on a UNIX system.</p>
104
<chmod perm="g+w">
105
<fileset dir="shared/sources1">
106
<exclude name="**/trial/**"/>
108
<fileset refid="other.shared.sources"/>
112
<p>makes all files below <code>shared/sources1</code> (except those
113
below any directory named trial) writable for members of the same
114
group on a UNIX system. In addition all files belonging to a FileSet
115
with <code>id</code> <code>other.shared.sources</code> get the same
117
<hr><p align="center">Copyright © 2000,2001 Apache Software Foundation. All rights