File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant Path problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant Path problem" Watch "Ant Path problem" New topic

Ant Path problem

Li Xin
Ranch Hand

Joined: Feb 06, 2004
Posts: 37

Can anybody tell me in Ant how to copy file from one drive to another? I tried this in my build file but does not work:

<path id=""><pathelement location="C:\project\src"/></path>
<path id=""><pathelement location="D:\project\backup"/> </path>
<copy todir="${}">
<fileset dir="${}" ><include name="*.java"/></fileset>
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I'm not really sure what you mean by "[it] does not work". Perhaps you just need to use slashes instead of backslashes in your paths.

The following example seems to work for me.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Ant Path problem
It's not a secret anymore!