S:\auth\dev\auth3>ant -version Apache Ant version 1.7.0 compiled on December 13 2006 I'm not sure if this is by design or not, but I can't find it doc'd and it does cause some confusion. Essentially, you can't set a path for an env var that does not contain a '\'. For instance: <env key="SystemDrive" path="c:"/> Results in SystemDrive=S:\auth\dev\auth3\c Where s:\auth\dev\auth3 is your working directory. To show this, it's easiest to create a target that allows you to view your env. For another reason, I can't just launch a cmd window. I don't know why. Perhaps this can be explained as well? In any case, I create a target named taskmgr that spawns taskmgr with a new env and just a couple of vars set. See below. So, launch the target and then view its env. Do this by running a command prompt via taskmgr > file > run. Then type set to view your env vars. <target name="taskmgr"> <exec dir="c:\windows\system32\" executable="c:\windows\system32\taskmgr.exe" newenvironment="true" > <env key="junk" path="c:" /> <env key="SystemDrive" value="c:"/> env vars are... COMSPEC=C:\windows\system32\cmd.exe PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS PROMPT=$P$G junk=S:\auth\dev\auth3\c SystemDrive=c: Note, junk is _incorrect_ Yet SystemDrive is correct. Why do you need to use value to set c: Isn't it a valid path? And why is it appended otherwise? Is this doc'd?
On a windows box, c: != c:\ Windows requires all Paths to have at least one '\' character to be valid. For example, open a command prompt and change the directory to anything other than the root. Then type "cd c:" and it will not take you to the root. Now type "cd c:\" and it will. Not sure if this helps (or is relevant), just thought I would share.
Yes, I understand that c: is not c:\ Perhaps I should ask, why a partial path is _cleaned_ and then appended to the working direcotry, Is that a bug? Is that doc'd? why does <env key="junk" path="c:" /> result in junk=S:\auth\dev\auth3\c Where is this doc'd? why is the ':' trimmed? I found the behavior ambiguous.
: is one of the supported path separators. So Ant doesnt know that "c:" refers to "./c" : "" or or c:\. 1. what does c:; get picked up as? 2. what does <env key="systemdrive" file="c:" /> get picked up as. Because there it is explicitly a file, not a path.
(In reply to comment #3) > : is one of the supported path separators. So Ant doesnt know that "c:" refers > to "./c" : "" or or c:\. > > 1. what does c:; get picked up as? > 2. what does <env key="systemdrive" file="c:" /> get picked up as. Because there > it is explicitly a file, not a path. Ah, I forgot that. Yes, while c: => ${pwd}/c is understandable, one would hope that c:; => (windows) c:${context} . In my tests, it is apparently interpreted as c:;=>"c"PATHSEP""PATHSEP=>${pwd}/c .