I am dealing with apache ant and want to see if a house holds a complete path or relative. How is this accomplished on home windows?

on the unix based system, I'm able to easily look for the the '/' int he begining. It is possible to built-in task to check on this or perhaps a more generic way?

Thanks!

Since Ant 1.8. was launched there's an element from the [cde] task that enables you to definitely convert between relative and absolute pathways inside a portable way. Theoretically then, should you set a house being an absolute path from the path that's already absolute, the 2 should match, whereas when the first rentals are relative, they ought to differ.

Here's sign:

property

Result:

<property name="abs.path" value="C:\my\path" />
<property name="rel.path" value="my\path" />

<property name="abs.candidate" location="${abs.path}" relative="no" />
<property name="rel.candidate" location="${rel.path}" relative="no" />

<echo message="ABS=${abs.candidate}"/>
<echo message="REL=${rel.candidate}"/>

The Buildfile: build.xml [echo] ABS=C:\my\path [echo] REL=C:\Martin\my\path attribute is not strictly needed because the default is 'no'. Note using relative="no" instead of location=, to ensure that Ant knows the road conversion ought to be applied.