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.

chown.html 3.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Chown Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="Chown">Chown</a></h2>
  8. <p><em>Since Ant 1.6.</em></p>
  9. <h3>Description</h3>
  10. <p>Changes the owner of a file or all files inside specified
  11. directories. Right now it has effect only under Unix. The owner
  12. atribute is equivalent to the coresponding argument for the chown
  13. command.</p>
  14. <p><a href="../CoreTypes/fileset.html">FileSet</a>s or <a
  15. href="../CoreTypes/filelist.html">FileList</a>s can be specified using
  16. nested <code>&lt;fileset&gt;</code> and <code>&lt;filelist&gt;</code>
  17. elements.</p>
  18. <h3>Parameters</h3>
  19. <table border="1" cellpadding="2" cellspacing="0">
  20. <tr>
  21. <td valign="top"><b>Attribute</b></td>
  22. <td valign="top"><b>Description</b></td>
  23. <td align="center" valign="top"><b>Required</b></td>
  24. </tr>
  25. <tr>
  26. <td valign="top">file</td>
  27. <td valign="top">the file or directory of which the owner must be
  28. changed.</td>
  29. <td valign="top" valign="middle">Yes or nested
  30. <code>&lt;fileset/list&gt;</code> elements.</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">owner</td>
  34. <td valign="top">the new owner.</td>
  35. <td valign="top" align="center">Yes</td>
  36. </tr>
  37. <tr>
  38. <td valign="top">parallel</td>
  39. <td valign="top">process all specified files using a single
  40. <code>chown</code> command. Defaults to true.</td>
  41. <td valign="top" align="center">No</td>
  42. </tr>
  43. <tr>
  44. <td valign="top">type</td>
  45. <td valign="top">One of <i>file</i>, <i>dir</i> or
  46. <i>both</i>. If set to <i>file</i>, only the owner of
  47. plain files are going to be changed. If set to <i>dir</i>, only
  48. the directories are considered.</td>
  49. <td align="center" valign="top">No, default is <i>file</i></td>
  50. </tr>
  51. <tr>
  52. <td valign="top">maxparallel</td>
  53. <td valign="top">Limit the amount of parallelism by passing at
  54. most this many sourcefiles at once. Set it to &lt;= 0 for
  55. unlimited. Defaults to unlimited.</td>
  56. <td align="center" valign="top">No</td>
  57. </tr>
  58. <tr>
  59. <td valign="top">verbose</td>
  60. <td valign="top">Whether to print a summary after execution or not.
  61. Defaults to <code>false</code>.</td>
  62. <td align="center" valign="top">No</td>
  63. </tr>
  64. </table>
  65. <h3>Examples</h3>
  66. <blockquote>
  67. <p><code>&lt;chown file=&quot;${dist}/start.sh&quot; owner=&quot;coderjoe&quot;/&gt;</code></p>
  68. </blockquote>
  69. <p>makes the &quot;start.sh&quot; file belong to coderjoe on a
  70. UNIX system.</p>
  71. <blockquote>
  72. <pre>
  73. &lt;chown owner=&quot;coderjoe&quot;&gt;
  74. &lt;fileset dir=&quot;${dist}/bin&quot; includes=&quot;**/*.sh&quot;/&gt;
  75. &lt;/chown&gt;
  76. </pre>
  77. </blockquote>
  78. <p>makes all &quot;.sh&quot; files below <code>${dist}/bin</code>
  79. belong to coderjoe on a UNIX system.</p>
  80. <blockquote>
  81. <pre>
  82. &lt;chown owner=&quot;coderjoe&quot;&gt;
  83. &lt;fileset dir=&quot;shared/sources1&quot;&gt;
  84. &lt;exclude name=&quot;**/trial/**&quot;/&gt;
  85. &lt;/fileset&gt;
  86. &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
  87. &lt;/chown&gt;
  88. </pre>
  89. </blockquote>
  90. <p>makes all files below <code>shared/sources1</code> (except those
  91. below any directory named trial) belong to coderjoe on a UNIX
  92. system. In addition all files belonging to a FileSet
  93. with <code>id</code> <code>other.shared.sources</code> get the same
  94. owner.</p>
  95. <hr>
  96. <p align="center">Copyright &copy; 2002-2003 Apache Software
  97. Foundation. All rights Reserved.</p>
  98. </body>
  99. </html>