ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Faulstich" <>
Subject RE: Copying specific files with full path specified
Date Mon, 21 Nov 2005 21:51:25 GMT
I figured it out.  There were extraneous spaces in the file list, so the
list really looked like this:
"    /foo/bar/myfile.jar,     /goo/car/myotherfile.jar"

This is due to the formatting in the property file where these are

I removed the spaces with a regex:

		<propertyregex property="postcompile.files.lib.remote"
			global="true" />

This puts an extra comma at the beginning, but that seems to be okay.

-----Original Message-----
From: Paul Faulstich [] 
Sent: Monday, November 21, 2005 4:25 PM
To: Ant Users List
Cc: Eric Wood
Subject: Copying specific files with full path specified

I am trying to copy a list of files, which have fully qualified paths

EG: "/foo/bar/myfile.jar, /goo/car/myotherfile.jar"
 or "F:\foo\bar\myfile.jar, G:\goo\car\myotherfile.jar"

Any advice on how to do this? (I'm using 1.6.5)

The following approaches do not work:

(1) use for loop.  For example:

		<for param="file" list="${files.lib.remote}">
				<copy file="@{file}"

  This approach generates this message:

     Warning: Could not find file /build/path/   /foo/bar/myfile.jar to

(2) use pathtofileset. For example:

		<path id="postcompile.files.remote">
				files="${files.lib.remote}" />
				name="postcompile.path.remote" />
		<copy todir="${dir.dist.uses}">
			<fileset refid="postcompile.path.remote" />

  This approach yields:

     /foo/bar/myfile.jar is not relative to /

BTW, my research of past postings shows that this (or a similar) topic
was covered in posts on the following dates:

2005-10-04: Jan Materne, Steve Loughram, et al discuss changes to copy
in 1.7 (Subject: Copy files according ant property)

2004-03-18: Jan Materne & Stefan Rufer - first approach suggested
(Subject: How to copy absolute paths)

2003-08-11: Adam Hardy & Peter Reilly discuss modifying <copy> to accept
filelists (Subject: "Copy" accepts FileList without any directory
limitation - enhancement?)

Paul Faulstich
Systems Analyst
L.L. Bean, Inc.
Freeport, ME 04033
(207) 552-2294

To unsubscribe, e-mail: For additional
commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message