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

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