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.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 (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. <h3>Parameters</h3>
  20. <table border="1" cellpadding="2" cellspacing="0">
  21. <tr>
  22. <td valign="top"><b>Attribute</b></td>
  23. <td valign="top"><b>Description</b></td>
  24. <td align="center" valign="top"><b>Required</b></td>
  25. </tr>
  26. <tr>
  27. <td valign="top">file</td>
  28. <td valign="top">the file or single directory of which the permissions
  29. must be changed.</td>
  30. <td valign="top" valign="middle" rowspan="2">exactly one of the two or nested <code>&lt;fileset&gt;</code> elements.</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">dir</td>
  34. <td valign="top">the directory which holds the files whose permissions
  35. must be changed.</td>
  36. </tr>
  37. <tr>
  38. <td valign="top">perm</td>
  39. <td valign="top">the new permissions.</td>
  40. <td valign="top" align="center">Yes</td>
  41. </tr>
  42. <tr>
  43. <td valign="top">includes</td>
  44. <td valign="top">comma- or space-separated list of patterns of files that must be
  45. included.</td>
  46. <td valign="top" align="center">No</td>
  47. </tr>
  48. <tr>
  49. <td valign="top">excludes</td>
  50. <td valign="top">comma- or space-separated list of patterns of files that must be
  51. excluded. No files (except default excludes) are excluded when omitted.</td>
  52. <td valign="top" align="center">No</td>
  53. </tr>
  54. <tr>
  55. <td valign="top">defaultexcludes</td>
  56. <td valign="top">indicates whether default excludes should be used or not
  57. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  58. <td valign="top" align="center">No</td>
  59. </tr>
  60. <tr>
  61. <td valign="top">parallel</td>
  62. <td valign="top">process all specified files using a single
  63. <code>chmod</code> command. Defaults to true.</td>
  64. <td valign="top" align="center">No</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">type</td>
  68. <td valign="top">One of <i>file</i>, <i>dir</i> or
  69. <i>both</i>. If set to <i>file</i>, only the permissions of
  70. plain files are going to be changed. If set to <i>dir</i>, only
  71. the directories are considered.</td>
  72. <td align="center" valign="top">No, default is <i>file</i></td>
  73. </tr>
  74. </table>
  75. <h3>Examples</h3>
  76. <blockquote>
  77. <p><code>&lt;chmod file=&quot;${dist}/start.sh&quot; perm=&quot;ugo+rx&quot;/&gt;</code></p>
  78. </blockquote>
  79. <p>makes the &quot;start.sh&quot; file readable and executable for anyone on a
  80. UNIX system.</p>
  81. <blockquote>
  82. <pre>
  83. &lt;chmod dir=&quot;${dist}/bin&quot; perm=&quot;ugo+rx&quot; includes=&quot;**/*.sh&quot;/&gt;
  84. </pre>
  85. </blockquote>
  86. <p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
  87. readable and executable for anyone on a UNIX system.</p>
  88. <blockquote>
  89. <pre>
  90. &lt;chmod perm=&quot;g+w&quot;&gt;
  91. &lt;fileset dir=&quot;shared/sources1&quot;&gt;
  92. &lt;exclude name=&quot;**/trial/**&quot;/&gt;
  93. &lt;/fileset&gt;
  94. &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
  95. &lt;/chmod&gt;
  96. </pre>
  97. </blockquote>
  98. <p>makes all files below <code>shared/sources1</code> (except those
  99. below any directory named trial) writable for members of the same
  100. group on a UNIX system. In addition all files belonging to a FileSet
  101. with <code>id</code> <code>other.shared.sources</code> get the same
  102. permissions.</p>
  103. <hr><p align="center">Copyright &copy; 2000-2003 Apache Software Foundation. All rights
  104. Reserved.</p>
  105. </body>
  106. </html>