In this example, path.separator is used to separate the path and file by semicolon (;). When it is run, Ant checks for the path separator and directory separator characters provided by the underlying JVM and uses those values. It successfully interprets either the ";" or the ":" inside the build file. For example, when run on Unix machine, ant interprets the path dir;dir\\subdir correctly as the dir;dir\\subdir. Separator must be used consistently with in the same value type; the string dir;dir\\subdir, combining a windows path separator (;) and a Unix directory separator (/) is not a good form.
<project name="PathSeperator" default="echo" basedir=".">
The following output will be displayed if you execute ant command on the
command prompt with appropriate path.
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: September 6, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles