ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject RE: reverse glob mapper pattern?
Date Tue, 24 Sep 2002 03:33:00 GMT
Hi Bruce,

Well, I stand corrected.  What you are saying is right.  However, you had 
it right before.  I *don't* want to delete the sample.* files.  They are 
the templates for the generated files.  I must have been doing something 
weird.  I swear that I tried the glob mapper in pretty much the same way 
you describe and, for some reason, it was deleting all files in the 
${src.dir} and all directories underneath.  I must have had something 
something a bit off.  I really don't know how that happened???   It made me 
run off on a wild goose chase and end up with the verbose result that I 
posted as an attachment earlier.

Anyway, the following works....

         <delete>
             <fileset dir="${src.dir}">
                 <exclude name="sample.*" />
                 <present targetdir="${src.dir}">
                     <mapper type="glob" from="*" to="sample.*" />
                 </present>
             </fileset>
         </delete>

Thanks for making me look at that again.  Man, I really can't figure out 
what I did wrong before?

Jake

At 06:12 PM 9/23/2002 -0700, you wrote:
>At 11:33 AM 9/23/2002 -0700, Diane Holt wrote:
>
>>No, it selects it says it does -- namely, it selects only those files that
>>have an equivalent, as specified. It doesn't say it'll return *both* the
>>files that have an equivalent *and* the equivalent file(s) as well.
>
>Ok, perhaps I misunderstood the original request. I thought he wanted to 
>keep the sample files, since those were the ones that generated the others.
>
>If the problem is getting both sets of files, it should be doable with a 
>single fileset.
>
>     <delete>
>         <fileset src="${src.dir}">
>             <or>
>                 <present>
>                     <mapper type="glob" from="sample.*" to="*" />
>                 </present>
>                 <present>
>                     <mapper type="glob" from="*" to="sample.*" />
>                 </present>
>             </or>
>         </fileset>
>     </delete>
>
>This appears to get around the "file already deleted" problem you 
>mentioned, Diane. In my tests, the <delete> task did not prematurely 
>delete the individual files before the whole fileset had been processed by 
>DirectoryScanner. I don't know if that is true for all tasks which might 
>change the contents of the fileset, though.
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message