You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by João Augusto Charnet <jo...@sfw.com.br> on 2005/09/15 19:04:44 UTC

Fileset search file

Hello,
I'm using Fileset to search through a series o files of the same 
extension (say *.jsf). I'd like to know if file set does a depth search, 
ou a width search through out the directories.
Example:
Let's say I have the following directory structure:
...
    |BaseDir
    |   |
    |   |Dir1
    |       |
    |       |File1.jsf
    |       |File2.jsf
    |   |Dir2
    |       |
    |       |File3.jsf
    |
    |File4.jsf
    |File4.jsf

What order would it return my files ?
File1, File2, File3, File4, File5 ?
Or
File4, File5, File1, File2, File3 ?

Thanks a lot.
John.
      
-- 

<http://www.sfw.com.br>Softway & Softcomex

	

Jo�o Augusto Charnet
Computer Engineer - R&D Team

Phone/Fax: 55 19 3739-9261
E-mail: joao.charnet@sfw.com.br <ma...@sfw.com.br>
R. Conceicao, 233 - Cj, 609 - Centro
13010-050 - Campinas - SP - Brazil


Re: Fileset search file

Posted by Antoine Levy-Lambert <an...@gmx.de>.
João Augusto Charnet wrote:

> Hello,
> I'm using Fileset to search through a series o files of the same
> extension (say *.jsf). I'd like to know if file set does a depth
> search, ou a width search through out the directories.
> Example:
> Let's say I have the following directory structure:
> ...
>     |BaseDir
>     |   |
>     |   |Dir1
>     |       |
>     |       |File1.jsf
>     |       |File2.jsf
>     |   |Dir2
>     |       |
>     |       |File3.jsf
>     |
>     |File4.jsf
>     |File4.jsf
>
> What order would it return my files ?
> File1, File2, File3, File4, File5 ?
> Or
> File4, File5, File1, File2, File3 ?
>
> Thanks a lot.
> John.

The javadoc says that the order is not determined. The current
implementation would rather deliver the first option, but you should not
rely on it.

Cheers,

Antoine

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


Re: Fileset search file

Posted by Matt Benson <gu...@yahoo.com>.
You can (or I might if I ever get time) write a custom
ResourceComparator for use with the sort collection.

-Matt

--- João Augusto Charnet <jo...@sfw.com.br>
wrote:

> Ok....
> I've downloaded a nightly build of ant, to see how
> the sort tag works.
> It still doesn't give me the ordering I need.
> \---01_Vdir1
>     |   01_file1.sql
>     |
>     +---00_Vdir2
>     |       00_file2.sql
>     |       01_file3.sql
>     |
>     \---01_Vdir3
>         |   01_file4.sql
>         |   02_file5.sql
>         |
>         \---01_dir4
>                 01_file6.sql
>                 02_file7.sql
>                 03_file8.sql
> 
> That's my directory structure.
> If I do a dir /s *.sql from the root dir, I get the
> files in the 
> following order :
> 
> 01_file1.sql
> 00_file2.sql
> 01_file3.sql
> 01_file4.sql
> 02_file5.sql
> 01_file6.sql
> 02_file7.sql
> 03_file8.sql
> 
> Which is exaclty what I'm looking for.
> When I use the sort tag, it's sorting by the file
> name, so it gives me 
> the following order:
> 00_file2.sql
> 01_file3.sql
> 01_file1.sql
> 01_file6.sql
> 02_file7.sql
> 03_file8.sql
> 01_file4.sql
> 02_file5.sql
> 
> Is there any atribute I can set in the sort tag so
> that it returns the 
> file as the dir /s command ?
> 
> Thanks a lot
> 
> John.
> 
> 
> Matt Benson wrote:
> 
> >--- João Augusto Charnet <jo...@sfw.com.br>
> >wrote:
> >
> >  
> >
> >>Is there any work around I can do to achieve some
> >>kind of ordering until 
> >>1.7 comes out?
> >>    
> >>
> >
> >You could subclass fileset to order things.
> >
> >  
> >
> >>Any idea on when 1.7 is coming out ?
> >>    
> >>
> >
> >Nothing concrete, hopefully by the end of the year
> at
> >the latest.
> >
> >-Matt
> >
> >
> >
> >		
> >__________________________________ 
> >Yahoo! Mail - PC Magazine Editors' Choice 2005 
> >http://mail.yahoo.com
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> >For additional commands, e-mail:
> user-help@ant.apache.org
> >
> >
> >  
> >
> 
> 
> -- 
> 
> <http://www.sfw.com.br>Softway & Softcomex
> 
> 	
> 
> João Augusto Charnet
> Computer Engineer - R&D Team
> 
> Phone/Fax: 55 19 3739-9261
> E-mail: joao.charnet@sfw.com.br
> <ma...@sfw.com.br>
> R. Conceicao, 233 - Cj, 609 - Centro
> 13010-050 - Campinas - SP - Brazil
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Fileset search file

Posted by João Augusto Charnet <jo...@sfw.com.br>.
Ok....
I've downloaded a nightly build of ant, to see how the sort tag works.
It still doesn't give me the ordering I need.
\---01_Vdir1
    |   01_file1.sql
    |
    +---00_Vdir2
    |       00_file2.sql
    |       01_file3.sql
    |
    \---01_Vdir3
        |   01_file4.sql
        |   02_file5.sql
        |
        \---01_dir4
                01_file6.sql
                02_file7.sql
                03_file8.sql

That's my directory structure.
If I do a dir /s *.sql from the root dir, I get the files in the 
following order :

01_file1.sql
00_file2.sql
01_file3.sql
01_file4.sql
02_file5.sql
01_file6.sql
02_file7.sql
03_file8.sql

Which is exaclty what I'm looking for.
When I use the sort tag, it's sorting by the file name, so it gives me 
the following order:
00_file2.sql
01_file3.sql
01_file1.sql
01_file6.sql
02_file7.sql
03_file8.sql
01_file4.sql
02_file5.sql

Is there any atribute I can set in the sort tag so that it returns the 
file as the dir /s command ?

Thanks a lot

John.


Matt Benson wrote:

>--- Jo�o Augusto Charnet <jo...@sfw.com.br>
>wrote:
>
>  
>
>>Is there any work around I can do to achieve some
>>kind of ordering until 
>>1.7 comes out?
>>    
>>
>
>You could subclass fileset to order things.
>
>  
>
>>Any idea on when 1.7 is coming out ?
>>    
>>
>
>Nothing concrete, hopefully by the end of the year at
>the latest.
>
>-Matt
>
>
>
>		
>__________________________________ 
>Yahoo! Mail - PC Magazine Editors' Choice 2005 
>http://mail.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>  
>


-- 

<http://www.sfw.com.br>Softway & Softcomex

	

Jo�o Augusto Charnet
Computer Engineer - R&D Team

Phone/Fax: 55 19 3739-9261
E-mail: joao.charnet@sfw.com.br <ma...@sfw.com.br>
R. Conceicao, 233 - Cj, 609 - Centro
13010-050 - Campinas - SP - Brazil


Re: Fileset search file

Posted by Matt Benson <gu...@yahoo.com>.
--- João Augusto Charnet <jo...@sfw.com.br>
wrote:

> Is there any work around I can do to achieve some
> kind of ordering until 
> 1.7 comes out?

You could subclass fileset to order things.

> Any idea on when 1.7 is coming out ?

Nothing concrete, hopefully by the end of the year at
the latest.

-Matt



		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: Fileset search file

Posted by João Augusto Charnet <jo...@sfw.com.br>.
Is there any work around I can do to achieve some kind of ordering until 
1.7 comes out?
Any idea on when 1.7 is coming out ?

Thanks .
John
Matt Benson wrote:

>;)  Correct; 1.7 will have a <sort> resource
>collection and several included resource comparators. 
>I didn't want to disappoint the guy, so hadn't said
>anything.
>
>-Matt
>
>--- Jeffrey E Care <ca...@us.ibm.com> wrote:
>
>  
>
>>I think some of Matt Benson's work on the HEAD (i.e.
>>Ant 1.7) branch for 
>>resource collections can do ordering.
>>
>>Unfortunately that won't help you on 1.6 ....
>>
>>-- 
>>Jeffrey E. Care (carej@us.ibm.com)
>>WebSphere v7 Release Engineer
>>WebSphere Build Tooling Lead (Project Mantis)
>>
>>
>>Jo�o Augusto Charnet <jo...@sfw.com.br> wrote
>>on 09/15/2005 
>>04:23:14 PM:
>>
>>    
>>
>>>Thanks for the response.
>>>Is there any way to guarantee the order of the
>>>      
>>>
>>files returned ?
>>    
>>
>>>Thanks again ...
>>>John
>>>Jeffrey E Care wrote:
>>>fileset goes not guarantee that the files it
>>>      
>>>
>>matches will be returned in 
>>
>>    
>>
>>>any particular order. I do believe that it will go
>>>      
>>>
>>depth-first, but 
>>within 
>>    
>>
>>>any given directory there is no guarantee on the
>>>      
>>>
>>order of the files in 
>>    
>>
>>>that directory, as this is dependant on the
>>>      
>>>
>>underlying JVM, native 
>>    
>>
>>>filesystem, etc.
>>>
>>>To use your example, you might get back either:
>>>
>>>        File1  File2  File3  File4  File5
>>>
>>>or:
>>>
>>>        File2  File1  File3  File5  File4
>>>
>>>
>>>
>>>      
>>>
>>>-- 
>>>
>>>[image removed] Softway & Softcomex 
>>>
>>>Jo�o Augusto Charnet
>>>Computer Engineer - R&D Team
>>>
>>>Phone/Fax: 55 19 3739-9261
>>>E-mail: joao.charnet@sfw.com.br 
>>>R. Conceicao, 233 - Cj, 609 - Centro
>>>13010-050 - Campinas - SP - Brazil
>>>      
>>>
>
>
>
>		
>__________________________________ 
>Yahoo! Mail - PC Magazine Editors' Choice 2005 
>http://mail.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>  
>


-- 

<http://www.sfw.com.br>Softway & Softcomex

	

Jo�o Augusto Charnet
Computer Engineer - R&D Team

Phone/Fax: 55 19 3739-9261
E-mail: joao.charnet@sfw.com.br <ma...@sfw.com.br>
R. Conceicao, 233 - Cj, 609 - Centro
13010-050 - Campinas - SP - Brazil


Re: Fileset search file

Posted by Matt Benson <gu...@yahoo.com>.
;)  Correct; 1.7 will have a <sort> resource
collection and several included resource comparators. 
I didn't want to disappoint the guy, so hadn't said
anything.

-Matt

--- Jeffrey E Care <ca...@us.ibm.com> wrote:

> I think some of Matt Benson's work on the HEAD (i.e.
> Ant 1.7) branch for 
> resource collections can do ordering.
> 
> Unfortunately that won't help you on 1.6 ....
> 
> -- 
> Jeffrey E. Care (carej@us.ibm.com)
> WebSphere v7 Release Engineer
> WebSphere Build Tooling Lead (Project Mantis)
> 
> 
> João Augusto Charnet <jo...@sfw.com.br> wrote
> on 09/15/2005 
> 04:23:14 PM:
> 
> > Thanks for the response.
> > Is there any way to guarantee the order of the
> files returned ?
> > 
> > Thanks again ...
> > John
> > Jeffrey E Care wrote:
> > fileset goes not guarantee that the files it
> matches will be returned in 
> 
> > any particular order. I do believe that it will go
> depth-first, but 
> within 
> > any given directory there is no guarantee on the
> order of the files in 
> > that directory, as this is dependant on the
> underlying JVM, native 
> > filesystem, etc.
> > 
> > To use your example, you might get back either:
> > 
> >         File1  File2  File3  File4  File5
> > 
> > or:
> > 
> >         File2  File1  File3  File5  File4
> > 
> > 
> > 
> 
> > -- 
> > 
> > [image removed] Softway & Softcomex 
> > 
> > João Augusto Charnet
> > Computer Engineer - R&D Team
> > 
> > Phone/Fax: 55 19 3739-9261
> > E-mail: joao.charnet@sfw.com.br 
> > R. Conceicao, 233 - Cj, 609 - Centro
> > 13010-050 - Campinas - SP - Brazil



		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: Fileset search file

Posted by Jeffrey E Care <ca...@us.ibm.com>.
I think some of Matt Benson's work on the HEAD (i.e. Ant 1.7) branch for 
resource collections can do ordering.

Unfortunately that won't help you on 1.6 ....

-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)


João Augusto Charnet <jo...@sfw.com.br> wrote on 09/15/2005 
04:23:14 PM:

> Thanks for the response.
> Is there any way to guarantee the order of the files returned ?
> 
> Thanks again ...
> John
> Jeffrey E Care wrote:
> fileset goes not guarantee that the files it matches will be returned in 

> any particular order. I do believe that it will go depth-first, but 
within 
> any given directory there is no guarantee on the order of the files in 
> that directory, as this is dependant on the underlying JVM, native 
> filesystem, etc.
> 
> To use your example, you might get back either:
> 
>         File1  File2  File3  File4  File5
> 
> or:
> 
>         File2  File1  File3  File5  File4
> 
> 
> 

> -- 
> 
> [image removed] Softway & Softcomex 
> 
> João Augusto Charnet
> Computer Engineer - R&D Team
> 
> Phone/Fax: 55 19 3739-9261
> E-mail: joao.charnet@sfw.com.br 
> R. Conceicao, 233 - Cj, 609 - Centro
> 13010-050 - Campinas - SP - Brazil

Re: Fileset search file

Posted by João Augusto Charnet <jo...@sfw.com.br>.
Thanks for the response.
Is there any way to guarantee the order of the files returned ?

Thanks again ...
John
Jeffrey E Care wrote:

>fileset goes not guarantee that the files it matches will be returned in 
>any particular order. I do believe that it will go depth-first, but within 
>any given directory there is no guarantee on the order of the files in 
>that directory, as this is dependant on the underlying JVM, native 
>filesystem, etc.
>
>To use your example, you might get back either:
>
>        File1  File2  File3  File4  File5
>
>or:
>
>        File2  File1  File3  File5  File4
>
>  
>


-- 

<http://www.sfw.com.br>Softway & Softcomex

	

Jo�o Augusto Charnet
Computer Engineer - R&D Team

Phone/Fax: 55 19 3739-9261
E-mail: joao.charnet@sfw.com.br <ma...@sfw.com.br>
R. Conceicao, 233 - Cj, 609 - Centro
13010-050 - Campinas - SP - Brazil


Re: Fileset search file

Posted by Jeffrey E Care <ca...@us.ibm.com>.
fileset goes not guarantee that the files it matches will be returned in 
any particular order. I do believe that it will go depth-first, but within 
any given directory there is no guarantee on the order of the files in 
that directory, as this is dependant on the underlying JVM, native 
filesystem, etc.

To use your example, you might get back either:

        File1  File2  File3  File4  File5

or:

        File2  File1  File3  File5  File4

-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)


João Augusto Charnet <jo...@sfw.com.br> wrote on 09/15/2005 
04:04:44 PM:

> Hello, 
> I'm using Fileset to search through a series o files of the same 
> extension (say *.jsf). I'd like to know if file set does a depth 
> search, ou a width search through out the directories.
> Example:
> Let's say I have the following directory structure:
> ...
>     |BaseDir
>     |   |
>     |   |Dir1
>     |       |
>     |       |File1.jsf
>     |       |File2.jsf
>     |   |Dir2
>     |       |
>     |       |File3.jsf
>     |
>     |File4.jsf
>     |File4.jsf
> 
> What order would it return my files ?
> File1, File2, File3, File4, File5 ?
> Or 
> File4, File5, File1, File2, File3 ?
> 
> Thanks a lot.
> John.
> 
> -- 
> 
> [image removed] Softway & Softcomex 
> 
> João Augusto Charnet
> Computer Engineer - R&D Team
> 
> Phone/Fax: 55 19 3739-9261
> E-mail: joao.charnet@sfw.com.br 
> R. Conceicao, 233 - Cj, 609 - Centro
> 13010-050 - Campinas - SP - Brazil