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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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>Ant User Manual</title>
  6. </head>
  7. <body>
  8. <h2><a name="attrib">Attrib</a></h2>
  9. <p><em>Since Ant 1.6.</em></p>
  10. <h3>Description</h3>
  11. <p>Changes the attributes of a file or all files inside specified
  12. directories. Right now it has effect only under Windows. Each of the
  13. 4 possible permissions has its own attribute, matching the arguments
  14. for the attrib 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 permissions 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">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.<br>
  56. <strong>Note:</strong> The type attribute does not apply to
  57. nested <i>dirset</i>s - <i>dirset</i>s always implicitly
  58. assume type to be <i>dir</i>.</td>
  59. <td align="center" valign="top">No, default is <i>file</i></td>
  60. </tr>
  61. <tr>
  62. <td valign="top">verbose</td>
  63. <td valign="top">Whether to print a summary after execution or not.
  64. Defaults to <code>false</code>.</td>
  65. <td align="center" valign="top">No</td>
  66. </tr>
  67. </table>
  68. <h3>Examples</h3>
  69. <blockquote>
  70. <pre>&lt;attrib file=&quot;${dist}/run.bat&quot; readonly=&quot;true&quot; hidden=&quot;true&quot;/&gt;</pre>
  71. </blockquote>
  72. <p>makes the &quot;run.bat&quot; file read-only and hidden.</p>
  73. <blockquote>
  74. <pre>&lt;attrib readonly=&quot;false&quot;&gt;
  75. &lt;fileset dir=&quot;${meta.inf}&quot; includes=&quot;**/*.xml&quot;/&gt;
  76. &lt;attrib&gt;
  77. </pre>
  78. </blockquote>
  79. <p>makes all &quot;.xml&quot; files below <code>${meta.inf}</code> readable.</p>
  80. <blockquote>
  81. <pre>
  82. &lt;attrib readonly=&quot;true&quot; archive=&quot;true&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;/attrib&gt;
  88. </pre>
  89. </blockquote>
  90. <p>makes all files below <code>shared/sources1</code> (except those below any
  91. directory named trial) read-only and archived. In addition all files belonging
  92. to a FileSet with <code>id</code> <code>other.shared.sources</code> get the
  93. same attributes.</p>
  94. <hr>
  95. <p align="center">Copyright &copy; 2002-2003,2005 Apache Software
  96. Foundation. All rights Reserved.</p>
  97. </body>
  98. </html>