Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert a relative path in Ant to an absolute path?

Tags:

ant

I would like to convert a relative path to an absolute path.

How is that done?

like image 399
JavaRocky Avatar asked Jun 28 '10 23:06

JavaRocky


People also ask

How do you convert relative path to absolute path?

The absolutePath function works by beginning at the starting folder and moving up one level for each "../" in the relative path. Then it concatenates the changed starting folder with the relative path to produce the equivalent absolute path.

Can absolute path and relative path be the same?

In simple words, an absolute path refers to the same location in a file system relative to the root directory, whereas a relative path points to a specific location in a file system relative to the current directory you are working on.

How do you type absolute path?

To write the absolute path, you have to use a slash “/” to start it, representing the root directory.


1 Answers

The location attribute on the property task will convert relative paths to absolute.

<property name="absolute.path" location="${relative.path}"/> 
like image 169
krock Avatar answered Sep 20 '22 15:09

krock