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 4.1 KiB

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