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.

dirname.html 1.6 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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>Dirname Task</title>
  6. </head>
  7. <body>
  8. <h2><a name="echo">Dirname</a></h2>
  9. <h3>Description</h3>
  10. <p>
  11. Task to determine the directory path of a specified file.
  12. </p>
  13. <p>
  14. When this task executes, it will set the specified property to the
  15. value of the specified file (or directory) up to, but not including,
  16. the last path element. If the specified file is a path that ends in a
  17. filename, the filename will be dropped. If the specified file is just
  18. a filename, the directory will be the current directory.
  19. </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 path to take the dirname of.</td>
  30. <td valign="top" align="center">Yes</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">property</td>
  34. <td valign="top">The name of the property to set.</td>
  35. <td valign="top" align="center">Yes</td>
  36. </tr>
  37. </table>
  38. <h3>Examples</h3>
  39. <pre> &lt;dirname property=&quot;antfile.dir&quot; file=&quot;${ant.file}&quot;/&gt;</pre>
  40. will set <code>antfile.dir</code> to the directory path for
  41. <code>${ant.file}</code>.
  42. <pre> &lt;dirname property=&quot;foo.dirname&quot; file=&quot;foo.txt&quot;/&gt;</pre>
  43. will set <code>foo.dirname</code> to the project's basedir.</p>
  44. <hr>
  45. <p align="center">Copyright &copy; 2002,2004-2005 The Apache Software Foundation.
  46. All rights Reserved.</p>
  47. </body>
  48. </html>