ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Kajsa" <Kajsa.Ander...@thomson.com>
Subject RE: Basic wildcard question
Date Fri, 19 Dec 2003 21:47:35 GMT
The difference is that "**/*.txt" will match "*.txt" in any subdirectory, no
matter how many levels down it might be, whereas "*/*.txt" will only look in
the directorys that are the immediate children of the parent directory.

So... in the case you gave, * and ** happen to both find toto.txt.  If your
structure was:

root_one
--leaf_one
    --some_other_directory
        --toto.txt
--leaf_two

the ** version would still find toto.txt, but the * version would not.  

HTH

Kajsa Anderso

-----Original Message-----
From: Julien Martin [mailto:julien-martin@wanadoo.fr]
Sent: Friday, December 19, 2003 3:38 PM
To: user@ant.apache.org
Subject: Basic wildcard question


Hello,

I am trying to understand the ** wildcard when used in include subtask.
Here is the line I don't understand :
<include name="**/*.txt"/>
as opposed to
<include name="*/*.txt"/>
What is the difference between those two lines? They seem to display the
same behavior.

Here is the xml in its entirety.

<?xml version="1.0"?>
<project name="monprojet" default="core" basedir=".">
<target name="core">
<copy todir="./root_one/leaf_two/">
 <fileset dir="./root_one/">
  <include name="**/*.txt"/>
 </fileset>
</copy>
</target>
</project>


The directory structure is as follows:

root_one
--leaf_one
    --toto.txt
--leaf_two

Thanks in advance,

Julien Martin.


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

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


Mime
View raw message