You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

chmod.html 4.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Chmod Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="chmod">Chmod</a></h2>
  8. <h3>Description</h3>
  9. <p>Changes the permissions of a file or all files inside specified
  10. directories. Right now it has effect only under Unix or NonStop Kernel (Tandem).
  11. The permissions are also UNIX style, like the argument for the chmod command.</p>
  12. <p>See the section on <a href="../dirtasks.html#directorybasedtasks">directory based
  13. tasks</a>, on how the inclusion/exclusion of files works, and how to
  14. write patterns.</p>
  15. <p>This task holds an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
  16. supports all of FileSet's attributes and nested elements
  17. directly. More FileSets can be specified using nested
  18. <code>&lt;fileset&gt;</code> elements.</p>
  19. <p>Starting with Ant 1.6, this task also supports nested <a
  20. href="../CoreTypes/filelist.html">filelist</a>s.</p>
  21. <h3>Parameters</h3>
  22. <table border="1" cellpadding="2" cellspacing="0">
  23. <tr>
  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>
  27. </tr>
  28. <tr>
  29. <td valign="top">file</td>
  30. <td valign="top">the file or single directory of which the permissions
  31. must be changed.</td>
  32. <td valign="top" valign="middle" rowspan="2">exactly one of the two or nested <code>&lt;fileset/list&gt;</code> elements.</td>
  33. </tr>
  34. <tr>
  35. <td valign="top">dir</td>
  36. <td valign="top">the directory which holds the files whose permissions
  37. must be changed.</td>
  38. </tr>
  39. <tr>
  40. <td valign="top">perm</td>
  41. <td valign="top">the new permissions.</td>
  42. <td valign="top" align="center">Yes</td>
  43. </tr>
  44. <tr>
  45. <td valign="top">includes</td>
  46. <td valign="top">comma- or space-separated list of patterns of files that must be
  47. included.</td>
  48. <td valign="top" align="center">No</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">excludes</td>
  52. <td valign="top">comma- or space-separated list of patterns of files that must be
  53. excluded. No files (except default excludes) are excluded when omitted.</td>
  54. <td valign="top" align="center">No</td>
  55. </tr>
  56. <tr>
  57. <td valign="top">defaultexcludes</td>
  58. <td valign="top">indicates whether default excludes should be used or not
  59. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  60. <td valign="top" align="center">No</td>
  61. </tr>
  62. <tr>
  63. <td valign="top">parallel</td>
  64. <td valign="top">process all specified files using a single
  65. <code>chmod</code> command. Defaults to true.</td>
  66. <td valign="top" align="center">No</td>
  67. </tr>
  68. <tr>
  69. <td valign="top">type</td>
  70. <td valign="top">One of <i>file</i>, <i>dir</i> or
  71. <i>both</i>. If set to <i>file</i>, only the permissions of
  72. plain files are going to be changed. If set to <i>dir</i>, only
  73. the directories are considered.</td>
  74. <td align="center" valign="top">No, default is <i>file</i></td>
  75. </tr>
  76. <tr>
  77. <td valign="top">maxparallel</td>
  78. <td valign="top">Limit the amount of parallelism by passing at
  79. most this many sourcefiles at once. Set it to &lt;= 0 for
  80. unlimited. Defaults to unlimited. <em>Since Ant 1.6.</em></td>
  81. <td align="center" valign="top">No</td>
  82. </tr>
  83. <tr>
  84. <td valign="top">verbose</td>
  85. <td valign="top">Whether to print a summary after execution or not.
  86. Defaults to <code>false</code>. <em>Since Ant 1.6.</em></td>
  87. <td align="center" valign="top">No</td>
  88. </tr>
  89. </table>
  90. <h3>Examples</h3>
  91. <blockquote>
  92. <p><code>&lt;chmod file=&quot;${dist}/start.sh&quot; perm=&quot;ugo+rx&quot;/&gt;</code></p>
  93. </blockquote>
  94. <p>makes the &quot;start.sh&quot; file readable and executable for anyone on a
  95. UNIX system.</p>
  96. <blockquote>
  97. <pre>
  98. &lt;chmod dir=&quot;${dist}/bin&quot; perm=&quot;ugo+rx&quot; includes=&quot;**/*.sh&quot;/&gt;
  99. </pre>
  100. </blockquote>
  101. <p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
  102. readable and executable for anyone on a UNIX system.</p>
  103. <blockquote>
  104. <pre>
  105. &lt;chmod perm=&quot;g+w&quot;&gt;
  106. &lt;fileset dir=&quot;shared/sources1&quot;&gt;
  107. &lt;exclude name=&quot;**/trial/**&quot;/&gt;
  108. &lt;/fileset&gt;
  109. &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
  110. &lt;/chmod&gt;
  111. </pre>
  112. </blockquote>
  113. <p>makes all files below <code>shared/sources1</code> (except those
  114. below any directory named trial) writable for members of the same
  115. group on a UNIX system. In addition all files belonging to a FileSet
  116. with <code>id</code> <code>other.shared.sources</code> get the same
  117. permissions.</p>
  118. <hr><p align="center">Copyright &copy; 2000-2003 Apache Software Foundation. All rights
  119. Reserved.</p>
  120. </body>
  121. </html>