ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Must specify a file not a directory in the filtersfile attribute
Date Fri, 28 Jun 2002 20:55:30 GMT
--- Olivier Gourment <> wrote:
> I want to use a filter file ONLY if it exists. The name of this filter
> file includes a variable part with a ${property}. When I do that and
> the filtersfile does not exist, I get the following error:
> Must specify a file not a directory in the filtersfile

The fact that part of the file name is a specified via a property doesn't
matter -- just the fact that the file doesn't exist does.

> First, the error message is a little misleading.

I'd say not only misleading, but a bug, since it should say something
about the file not being found, not tell you've specified a directory when
clearly you haven't. Want to supply a patch?

> Second, is there a way to make this work, apart from creating an
> empty file named

If you can live with Ant barking at you about overriding a reference, yes:

  <filterset id="fls01"/>

  <target name="init.filters01" if="filters01.available"
    <filterset id="fls01">
      <filtersfile file=""/>

  <target name="chkFilters01">
    <available file="" type="file"

  <target name="doCopy" depends="init.filters01">
    <copy file="orig.txt" tofile="copied.txt" filtering="on">
      <filterset refid="fls01"/>



Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

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

View raw message