This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant Path problem" Watch "Ant Path problem" New topic
Author

Ant Path problem

Li Xin
Ranch Hand

Joined: Feb 06, 2004
Posts: 37
Hi!

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="source.java.dir"><pathelement location="C:\project\src"/></path>
<path id="backup.java.dir"><pathelement location="D:\project\backup"/> </path>
<copy todir="${backup.java.dir}">
<fileset dir="${source.java.dir}" ><include name="*.java"/></fileset>
</copy>
Dirk Schreckmann
Sheriff

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: http://aspose.com/file-tools
 
subject: Ant Path problem