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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 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 permissions 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">readonly</td>
  34. <td valign="top">the readonly permission.</td>
  35. <td valign="top" rowspan="4">at least one of the four. </td>
  36. </tr>
  37. <tr>
  38. <td valign="top">archive</td>
  39. <td valign="top">the archive permission.</td>
  40. </tr>
  41. <tr>
  42. <td valign="top">system</td>
  43. <td valign="top">the system permission.</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">hidden</td>
  47. <td valign="top">the hidden permission.</td>
  48. </tr>
  49. <tr>
  50. <td valign="top">type</td>
  51. <td valign="top">One of <i>file</i>, <i>dir</i> or <i>both</i>. If set to
  52. <i>file</i>, only the permissions of plain files are going to be changed.
  53. If set to <i>dir</i>, only the directories are considered.</td>
  54. <td align="center" valign="top">No, default is <i>file</i></td>
  55. </tr>
  56. <tr>
  57. <td valign="top">verbose</td>
  58. <td valign="top">Whether to print a summary after execution or not.
  59. Defaults to <code>false</code>.</td>
  60. <td align="center" valign="top">No</td>
  61. </tr>
  62. </table>
  63. <h3>Examples</h3>
  64. <blockquote>
  65. <p><code>&lt;attrib file=&quot;${dist}/run.bat&quot; readonly=&quot;true&quot; hidden=&quot;true&quot;/&gt;</code></p>
  66. </blockquote>
  67. <p>makes the &quot;run.bat&quot; file read-only and hidden.</p>
  68. <blockquote>
  69. <pre>&lt;attrib readonly=&quot;false&quot;&gt;
  70. &lt;fileset dir=&quot;${meta.inf}&quot; includes=&quot;**/*.xml&quot;/&gt;
  71. &lt;attrib&gt;
  72. </pre>
  73. </blockquote>
  74. <p>makes all &quot;.xml&quot; files below <code>${meta.inf}</code> readable.</p>
  75. <blockquote>
  76. <pre>
  77. &lt;attrib readonly=&quot;true&quot; archive=&quot;true&quot;&gt;
  78. &lt;fileset dir=&quot;shared/sources1&quot;&gt;
  79. &lt;exclude name=&quot;**/trial/**&quot;/&gt;
  80. &lt;/fileset&gt;
  81. &lt;fileset refid=&quot;other.shared.sources&quot;/&gt;
  82. &lt;/attrib&gt;
  83. </pre>
  84. </blockquote>
  85. <p>makes all files below <code>shared/sources1</code> (except those below any
  86. directory named trial) read-only and archived. In addition all files belonging
  87. to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
  88. same attributes.</p>
  89. <hr>
  90. <p align="center">Copyright &copy; 2002-2003 Apache Software
  91. Foundation. All rights Reserved.</p>
  92. </body>
  93. </html>