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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. <p><em>Since Ant 1.6.</em></p>
  9. <h3>Description</h3>
  10. <p>Changes the attributes of a file or all files inside specified
  11. directories. Right now it has effect only under Windows. Each of the
  12. 4 possible permissions has its own attribute, matching the arguments
  13. for the attrib command.</p>
  14. <p><a href="../CoreTypes/fileset.html">FileSet</a>s,
  15. <a href="../CoreTypes/dirset.html">DirSet</a>s or <a
  16. href="../CoreTypes/filelist.html">FileList</a>s can be specified using
  17. nested <code>&lt;fileset&gt;</code>, <code>&lt;dirset&gt;</code> and
  18. <code>&lt;filelist&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 directory of which the permissions must be
  29. changed.</td>
  30. <td valign="top" valign="middle">Yes or nested
  31. <code>&lt;fileset/list&gt;</code> elements.</td>
  32. </tr>
  33. <tr>
  34. <td valign="top">readonly</td>
  35. <td valign="top">the readonly permission.</td>
  36. <td valign="top" rowspan="4">at least one of the four. </td>
  37. </tr>
  38. <tr>
  39. <td valign="top">archive</td>
  40. <td valign="top">the archive permission.</td>
  41. </tr>
  42. <tr>
  43. <td valign="top">system</td>
  44. <td valign="top">the system permission.</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">hidden</td>
  48. <td valign="top">the hidden permission.</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">type</td>
  52. <td valign="top">One of <i>file</i>, <i>dir</i> or <i>both</i>. If set to
  53. <i>file</i>, only the permissions of plain files are going to be changed.
  54. If set to <i>dir</i>, only the directories are considered.<br>
  55. <strong>Note:</strong> The type attribute does not apply to
  56. nested <i>dirset</i>s - <i>dirset</i>s always implicitly
  57. assume type to be <i>dir</i>.</td>
  58. <td align="center" valign="top">No, default is <i>file</i></td>
  59. </tr>
  60. <tr>
  61. <td valign="top">verbose</td>
  62. <td valign="top">Whether to print a summary after execution or not.
  63. Defaults to <code>false</code>.</td>
  64. <td align="center" valign="top">No</td>
  65. </tr>
  66. </table>
  67. <h3>Examples</h3>
  68. <blockquote>
  69. <p><code>&lt;attrib file=&quot;${dist}/run.bat&quot; readonly=&quot;true&quot; hidden=&quot;true&quot;/&gt;</code></p>
  70. </blockquote>
  71. <p>makes the &quot;run.bat&quot; file read-only and hidden.</p>
  72. <blockquote>
  73. <pre>&lt;attrib readonly=&quot;false&quot;&gt;
  74. &lt;fileset dir=&quot;${meta.inf}&quot; includes=&quot;**/*.xml&quot;/&gt;
  75. &lt;attrib&gt;
  76. </pre>
  77. </blockquote>
  78. <p>makes all &quot;.xml&quot; files below <code>${meta.inf}</code> readable.</p>
  79. <blockquote>
  80. <pre>
  81. &lt;attrib readonly=&quot;true&quot; archive=&quot;true&quot;&gt;
  82. &lt;fileset dir=&quot;shared/sources1&quot;&gt;
  83. &lt;exclude name=&quot;**/trial/**&quot;/&gt;
  84. &lt;/fileset&gt;
  85. &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
  86. &lt;/attrib&gt;
  87. </pre>
  88. </blockquote>
  89. <p>makes all files below <code>shared/sources1</code> (except those below any
  90. directory named trial) read-only and archived. In addition all files belonging
  91. to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
  92. same attributes.</p>
  93. <hr>
  94. <p align="center">Copyright &copy; 2002-2003 Apache Software
  95. Foundation. All rights Reserved.</p>
  96. </body>
  97. </html>