ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32977] New: - Ant handles ".." in paths incorrectly
Date Thu, 06 Jan 2005 22:12:41 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32977>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32977

           Summary: Ant handles ".." in paths incorrectly
           Product: Ant
           Version: 1.6.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: ips@apache.org


The below build.xml:

<project name="foo" basedir="C:/">
   <property name="my.dir" location=".."/>
   <echo>${my.dir}</echo>
</project>

results in the following error:
BUILD FAILED
C:\build.xml:5: The file or path you specified (..) is invalid relative to C:\

I don't think this is correct. On Windows or Unix, ".." always works, even 
relative to a root dir, in which case it resolves to ".".

For example, from Windows:

C:\>cd ..

C:\>cd ..\..\..

C:\>

And the same goes for Java:

File file = new File( "C:/", ".." );
System.out.println( file.getCanonicalPath() );

outputs:

C:\

I think Ant should be consistent to Windows, Unix, and most importantly, Java 
in its behavior.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message