Home Tutorials Ant Path Separator
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Path Separator

Advertisement
In this example, path.separator is used to separate the path and file by semicolon (;).

Path Separator

     

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=".">

  <target name="echo">
  <echo message="File: ${basedir}${path.separator}build.xml"/>
  <echo message="Path: ${basedir}${path.separator}build.xml${path.separator}
   ${basedir}${path.separator}build.properties"/>
  </target>

</project>

The following output will be displayed if you execute ant command on the command prompt with appropriate path. 


Download Source Code

     

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 6, 2008

Related Tutorials

Ask Questions?    Discuss: Path Separator  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com