ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Ludwig <mil...@gmx.de>
Subject Re: Copying a static list of files
Date Thu, 24 Jun 2010 21:17:50 GMT
Patrick Martin schrieb am 24.06.2010 um 21:21 (+0200):
> Sorry, I meant to say that "spaces in filenames are unfriendly with
> filelist", not filesets....

Not sure I understand the problem you're facing, but <filelist>
definitely works with filenames containing spaces, you just have
to put them in a nested <file> element.

G:\dev\Ant :: more /t2 spacelist.txt
G:\dev\Ant\dir with spaces\d r e i.txt
G:\dev\Ant\dir with spaces\eins.txt
G:\dev\Ant\dir with spaces\zwei.txt

G:\dev\Ant :: more /t2 spacelist.xml
<!-- vim: set filetype=ant :-->
<project>

  <echo>Do &lt;loadfile> and &lt;filelist>
  work with spacy filenames?</echo>

  <loadfile property="file.list" srcfile="spacelist.txt"/>
  <echo message="${file.list}"/>
  <echo>  So it works using &lt;loadfile>.</echo>

  <filelist id="space.list" dir="dir with spaces"
    files="eins.txt zwei.txt">
    <file name="d r e i.txt"/>
  </filelist>
  <pathconvert refid="space.list"
    pathsep="${line.separator}" property="space.prop"/>
  <echo message="${space.prop}"/>
  <echo>  And it also works using &lt;filelist>.</echo>

</project>

G:\dev\Ant :: ant -f spacelist.xml
Buildfile: G:\dev\Ant\spacelist.xml
     [echo] Do <loadfile> and <filelist>
     [echo]   work with spacy filenames?
     [echo] G:\dev\Ant\dir with spaces\d r e i.txt
     [echo] G:\dev\Ant\dir with spaces\eins.txt
     [echo] G:\dev\Ant\dir with spaces\zwei.txt
     [echo]   So it works using <loadfile>.
     [echo] G:\dev\Ant\dir with spaces\eins.txt
     [echo] G:\dev\Ant\dir with spaces\zwei.txt
     [echo] G:\dev\Ant\dir with spaces\d r e i.txt
     [echo]   And it also works using <filelist>.

BUILD SUCCESSFUL

-- 
Michael Ludwig

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


Mime
View raw message