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.

attrib.html 3.1 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="attrib">Attrib</a></h2>
  8. <h3>Description</h3>
  9. <p>Changes the attributes of a file or all files inside specified
  10. directories. Right now it has effect only under Windows. Each of the
  11. 4 possible permissions has its own attribute, matching the arguments
  12. for the attrib command.</p>
  13. <p><a href="../CoreTypes/fileset.html">FileSet</a> can be specified
  14. using nested <code>&lt;fileset&gt;</code> elements.</p>
  15. <h3>Parameters</h3>
  16. <table border="1" cellpadding="2" cellspacing="0">
  17. <tr>
  18. <td valign="top"><b>Attribute</b></td>
  19. <td valign="top"><b>Description</b></td>
  20. <td align="center" valign="top"><b>Required</b></td>
  21. </tr>
  22. <tr>
  23. <td valign="top">file</td>
  24. <td valign="top">the file of which the permissions must be
  25. changed.</td>
  26. <td valign="top" valign="middle" rowspan="2">one of the two or
  27. nested <code>&lt;fileset&gt;</code> elements.</td>
  28. </tr>
  29. <tr>
  30. <td valign="top">dir</td>
  31. <td valign="top">the directory whose permissions must be
  32. changed.</td>
  33. </tr>
  34. <tr>
  35. <td valign="top">readonly</td>
  36. <td valign="top">the readonly permission.</td>
  37. <td valign="top" rowspan="4">at least one of the four. </td>
  38. </tr>
  39. <tr>
  40. <td valign="top">archive</td>
  41. <td valign="top">the archive permission.</td>
  42. </tr>
  43. <tr>
  44. <td valign="top">system</td>
  45. <td valign="top">the system permission.</td>
  46. </tr>
  47. <tr>
  48. <td valign="top">hidden</td>
  49. <td valign="top">the hidden permission.</td>
  50. </tr>
  51. <tr>
  52. <td valign="top">type</td>
  53. <td valign="top">One of <i>file</i>, <i>dir</i> or <i>both</i>. If set to
  54. <i>file</i>, only the permissions of plain files are going to be changed.
  55. If set to <i>dir</i>, only the directories are considered.</td>
  56. <td align="center" valign="top">No, default is <i>file</i></td>
  57. </tr>
  58. </table>
  59. <h3>Examples</h3>
  60. <blockquote>
  61. <p><code>&lt;attrib file=&quot;${dist}/run.bat&quot; readonly=&quot;true&quot; hidden=&quot;true&quot;/&gt;</code></p>
  62. </blockquote>
  63. <p>makes the &quot;run.bat&quot; file read-only and hidden.</p>
  64. <blockquote>
  65. <pre>&lt;attrib readonly=&quot;false&quot;&gt;
  66. &lt;fileset dir=&quot;${meta.inf}&quot; includes=&quot;**/*.xml&quot;/&gt;
  67. &lt;attrib&gt;
  68. </pre>
  69. </blockquote>
  70. <p>makes all &quot;.xml&quot; files below <code>${meta.inf}</code> readable.</p>
  71. <blockquote>
  72. <pre>
  73. &lt;attrib readonly=&quot;true&quot; archive=&quot;true&quot;&gt;
  74. &lt;fileset dir=&quot;shared/sources1&quot;&gt;
  75. &lt;exclude name=&quot;**/trial/**&quot;/&gt;
  76. &lt;/fileset&gt;
  77. &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
  78. &lt;/attrib&gt;
  79. </pre>
  80. </blockquote>
  81. <p>makes all files below <code>shared/sources1</code> (except those below any
  82. directory named trial) read-only and archived. In addition all files belonging
  83. to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
  84. same attributes.</p>
  85. <hr>
  86. <p align="center">Copyright &copy; 2002 Apache Software
  87. Foundation. All rights Reserved.</p>
  88. </body>
  89. </html>