ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilbert Rebhan <>
Subject Re: DirectoryScanner exclude subdirectories ?
Date Thu, 06 Oct 2005 19:44:21 GMT

Matt Benson wrote:
> I can't remember the entire context of this
> discussion... but includes/excludes are used by
> DirectoryScanner.  To include only child "files" of
> basedir, the correct include pattern is "*".  However,
> this includes directories which are basedir's
> immediate children.  To further restrict the selection
> to non-directory files, use the <type> selector as
> well.
> -Matt

my first post was =


i want to use the DirectoryScanner in an own task.

i want to exclude subdirectories and only including
the files in the root of basedir.

DirectoryScanner ds = fs.getDirectoryScanner(getProject());
        String[] includes = {"*.*"};
        String[] excludes = {"**\\**"};
String[] names = ds.getIncludedFiles();

What are the correct include / exclude patterns to
include ownly the files in root of basedir but exclude
all subdirectories and files in subdirectories ?


i want to use it in a selfwritten task not in an

Question =

is it possible to use DirecoryScanner standalone or only combined
with a type selector ?

i believe it's easier to roll my own solution instead of using
DirectoryScanner combined with a selector.

Regards, Gilbert

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

View raw message