2

How to get the ant root directory (in a crossplatform way) ?

For example:

  • in linux or macosx would be: /
  • in windows would be: C:/
  • etc..

Thanks..

alem0lars
  • 660
  • 2
  • 10
  • 23
  • what do you mean ant root dir would be c:/ in windows and / in linux? – asgs Feb 23 '11 at 09:47
  • yes. I would like to get a property with for example C:/ in windows and / in linux – alem0lars Feb 23 '11 at 09:48
  • 1
    you can try this option: http://stackoverflow.com/questions/453170/using-ant-to-detect-os-and-set-property/32711314#32711314 – elkoo Sep 22 '15 at 07:58

1 Answers1

2

I don't think you can get that directly.

Probably, you can get the user.home system property and extract the root from it.

adarshr
  • 61,315
  • 23
  • 138
  • 167