You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ziggy <zi...@gmail.com> on 2009/12/18 13:59:45 UTC
Filesets
Hi,
I am trying to understand how the selection of files and directories work.
Could you explain the difference between the following.
exclude name="**/pages"/>
<exclude name="**/pages/**"/>
<exclude name="pages/**"/>
<exclude name="**/pages**"/>
<exclude name="**/pages/>
<exclude name="*/pages/>
<exclude name="*/pages/*>
Thanks
Re: Filesets
Posted by Ziggy <zi...@gmail.com>.
Thanks all for all your help.
I think i understand them better now. I will be practising with more
examples and hopefully ill get better at it.
Thanks
On Fri, Dec 18, 2009 at 4:13 PM, David Weintraub <qa...@gmail.com> wrote:
> On Fri, Dec 18, 2009 at 9:55 AM, Ziggy <zi...@gmail.com> wrote:
> > In all your examples you refered to "files" but not directories. Did you
> > mean files and directories?
>
> Filesets select files and not directories. If you want to select
> directories, you use "dirset".
>
> > could you check the examples below and let me know if i got it right
> >
> >>exclude name="**/pages"/>
> >>Takes all files from any subdir called "pages" but no subdir of pages
>
> You want "<exclude name="**/pages/*">
>
> This will only select the files directly under the pages directory,
> but not files that are located in subdirectories under pages. The "**"
> is a wildcard match for files in the directory tree while the "*" is a
> wildcard match just for the files in that directory.
>
> Again: <fileset> selects files and not directories. If you must match
> on directories, you need to use <dirset>. 90% of the time, you use
> <fileset> because you're interested in the files and not the
> directories.
>
> So:
>
> <include name="**/pages/**">
> Will match
>
> * a/b/c/pages/1.txt
> * a/b/c/pages/2.txt
> * a/b/c/pages/d/1.txt
> * a/b/c/pages/d/e/f/g/h/2.txt
>
> But, it won't match:
>
> * a/b/c/pages/
> * a/b/c/pages/d/
> * a/b/c/pages/d/e/f/
> * a/b/c/pages/d/e/f/g/h/
>
> because those are DIRECTORIES.
>
> Meanwhile:
>
> <include name="**/pages/*"/>
>
> Will match
>
> * a/b/c/pages/1.txt
> * a/b/c/pages/2.txt
>
> But it won't match:
>
> * a/b/c/pages/d/1.txt
> * a/b/c/pages/d/e/f/g/h/2.txt
>
> --
> David Weintraub
> qazwart@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: Filesets
Posted by David Weintraub <qa...@gmail.com>.
On Fri, Dec 18, 2009 at 9:55 AM, Ziggy <zi...@gmail.com> wrote:
> In all your examples you refered to "files" but not directories. Did you
> mean files and directories?
Filesets select files and not directories. If you want to select
directories, you use "dirset".
> could you check the examples below and let me know if i got it right
>
>>exclude name="**/pages"/>
>>Takes all files from any subdir called "pages" but no subdir of pages
You want "<exclude name="**/pages/*">
This will only select the files directly under the pages directory,
but not files that are located in subdirectories under pages. The "**"
is a wildcard match for files in the directory tree while the "*" is a
wildcard match just for the files in that directory.
Again: <fileset> selects files and not directories. If you must match
on directories, you need to use <dirset>. 90% of the time, you use
<fileset> because you're interested in the files and not the
directories.
So:
<include name="**/pages/**">
Will match
* a/b/c/pages/1.txt
* a/b/c/pages/2.txt
* a/b/c/pages/d/1.txt
* a/b/c/pages/d/e/f/g/h/2.txt
But, it won't match:
* a/b/c/pages/
* a/b/c/pages/d/
* a/b/c/pages/d/e/f/
* a/b/c/pages/d/e/f/g/h/
because those are DIRECTORIES.
Meanwhile:
<include name="**/pages/*"/>
Will match
* a/b/c/pages/1.txt
* a/b/c/pages/2.txt
But it won't match:
* a/b/c/pages/d/1.txt
* a/b/c/pages/d/e/f/g/h/2.txt
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Filesets
Posted by Ziggy <zi...@gmail.com>.
Hi thanks for your response. I think i understood most of them except for a
few that still confuse me.
In all your examples you refered to "files" but not directories. Did you
mean files and directories?
could you check the examples below and let me know if i got it right
>exclude name="**/pages"/>
>Takes all files from any subdir called "pages" but no subdir of pages
YES
a/b/c/pages/1.txt
d/e/pages/1.txt
NO
a/b/c/pages/r
><exclude name="**/pages/**"/>
>Takes all files from any subdir called "pages" but and all files of subdirs
of pages
YES
a/b/c/pages/1.txt
a/c/pages/2.txt
a/c/pages/4.txt
a/b/pages/d/a/3.txt
a/b/pages/d/4.txt
a/g/h/pages/f/4.txt
NO
a/b/b
c/d/c
><exclude name="pages/**"/>
>takes all files of subdirs of pages
Is this the same as above? what would have been the difference if the
pattern was pages/* or **/pages/* instead of pages/**
><exclude name="**/pages**"/>
>Takes all files that filenam starts with pages
I understood this one.
><exclude name="**/pages/>
>Syntax error because second " is missing
if there was the second ", would it have picked any files from any
subdirectory called pages in any directory?
><exclude name="*/pages" /> (second " added)
>Takes all files from a subdir called "pages", that is one dir deep
(xxx/pages but not xxx/xxx/pages) but no subdir of pages
I thought * is meant for files only?
><exclude name="*/pages/*"> (second " added)
>Takes all subdirs of depth 1 from a subdir pages that is depth 1
(xx/pages/xx, but not xx/pages/xx/xx )
I actually thought that this meant it would take any file that is in the
pages directory.
Thanks
On Fri, Dec 18, 2009 at 1:33 PM, Knuplesch, Juergen <
Juergen.Knuplesch@icongmbh.de> wrote:
> Hello
>
> exclude name="**/pages"/>
> Takes all files from any subdir called "pages" but no subdir of pages
>
> <exclude name="**/pages/**"/>
> Takes all files from any subdir called "pages" but and all files of subdirs
> of pages
>
> <exclude name="pages/**"/>
> takes all files of subdirs of pages
>
> <exclude name="**/pages**"/>
> Takes all files that filenam starts with pages
>
> <exclude name="**/pages/>
> Syntax error because second " is missing
>
> <exclude name="*/pages" /> (second " added)
> Takes all files from a subdir called "pages", that is one dir deep
> (xxx/pages but not xxx/xxx/pages) but no subdir of pages
>
> <exclude name="*/pages/*"> (second " added)
> Takes all subdirs of depth 1 from a subdir pages that is depth 1
> (xx/pages/xx, but not xx/pages/xx/xx )
>
>
> --
> Jürgen Knuplesch
> -----Ursprüngliche Nachricht-----
> Von: Ziggy [mailto:ziggy25@gmail.com]
> Gesendet: Freitag, 18. Dezember 2009 14:00
> An: Ant Users List
> Betreff: Filesets
>
> Hi,
>
> I am trying to understand how the selection of files and directories work.
> Could you explain the difference between the following.
>
> exclude name="**/pages"/>
> <exclude name="**/pages/**"/>
> <exclude name="pages/**"/>
> <exclude name="**/pages**"/>
> <exclude name="**/pages/>
> <exclude name="*/pages/>
> <exclude name="*/pages/*>
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
AW: Filesets
Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
Hello
exclude name="**/pages"/>
Takes all files from any subdir called "pages" but no subdir of pages
<exclude name="**/pages/**"/>
Takes all files from any subdir called "pages" but and all files of subdirs of pages
<exclude name="pages/**"/>
takes all files of subdirs of pages
<exclude name="**/pages**"/>
Takes all files that filenam starts with pages
<exclude name="**/pages/>
Syntax error because second " is missing
<exclude name="*/pages" /> (second " added)
Takes all files from a subdir called "pages", that is one dir deep (xxx/pages but not xxx/xxx/pages) but no subdir of pages
<exclude name="*/pages/*"> (second " added)
Takes all subdirs of depth 1 from a subdir pages that is depth 1 (xx/pages/xx, but not xx/pages/xx/xx )
--
Jürgen Knuplesch
-----Ursprüngliche Nachricht-----
Von: Ziggy [mailto:ziggy25@gmail.com]
Gesendet: Freitag, 18. Dezember 2009 14:00
An: Ant Users List
Betreff: Filesets
Hi,
I am trying to understand how the selection of files and directories work.
Could you explain the difference between the following.
exclude name="**/pages"/>
<exclude name="**/pages/**"/>
<exclude name="pages/**"/>
<exclude name="**/pages**"/>
<exclude name="**/pages/>
<exclude name="*/pages/>
<exclude name="*/pages/*>
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org