You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by cvsusr <sp...@rediffmail.com> on 2009/11/11 11:13:10 UTC
Need help!! Ant find duplicate files
Is there any Ant experts who can provide a solutions for this scenario... ??
Thanks in advance..
cvsusr wrote:
>
> Hi
>
> In my ant build,
>
> I need to find duplicate files under set of dirs and if found, copy it to
> the temp directory.
>
> say in my current dir i have chk/src/a.txt and chk/src2/a.txt and
> chk/src2/b.txt
>
> the task should find a.txt under src and src2 and copy it to chk/test dir
> with folder names
>
> Can this be done in any way..
>
> Thanks
>
--
View this message in context: http://old.nabble.com/Ant-find-duplicate-files-tp26230907p26298938.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Need help!! Ant find duplicate files
Posted by "Scot P. Floess" <sf...@nc.rr.com>.
For scripting.... I like beanshell myself :)
On Wed, 11 Nov 2009, cvsusr wrote:
>
> Is there any Ant experts who can provide a solutions for this scenario... ??
>
> Thanks in advance..
>
>
>
>
> cvsusr wrote:
>>
>> Hi
>>
>> In my ant build,
>>
>> I need to find duplicate files under set of dirs and if found, copy it to
>> the temp directory.
>>
>> say in my current dir i have chk/src/a.txt and chk/src2/a.txt and
>> chk/src2/b.txt
>>
>> the task should find a.txt under src and src2 and copy it to chk/test dir
>> with folder names
>>
>> Can this be done in any way..
>>
>> Thanks
>>
>
> --
> View this message in context: http://old.nabble.com/Ant-find-duplicate-files-tp26230907p26298938.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-890-8117 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
Architect Keros http://sourceforge.net/projects/keros
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Need help!! Ant find duplicate files
Posted by Greg Roodt <gr...@gmail.com>.
Adam's suggestion of a script is probably going to be the simplest solution.
Another option may be to take a look at the Checksum task and generate MD5
hashes for the files, then compare the MD5 hash values for each file, if the
values are equal, then you know you have a duplicate. You could then delete
all the MD5 files.
This solution may be a bit clunky, but it should work.
On Wed, Nov 11, 2009 at 10:18 AM, Adam Leggett (UPCO) <
adam.leggett@upco.co.uk> wrote:
> If you are comfortable with scripting using syntax akin to Java, i'd
> suggest you use the groovy ant task to do something like this
>
> http://groovy.codehaus.org/The+groovy+Ant+Task
>
>
> Thanks
>
> Adam
>
> On Wed, 2009-11-11 at 02:13 -0800, cvsusr wrote:
> > Is there any Ant experts who can provide a solutions for this scenario...
> ??
> >
> > Thanks in advance..
> >
> >
> >
> >
> > cvsusr wrote:
> > >
> > > Hi
> > >
> > > In my ant build,
> > >
> > > I need to find duplicate files under set of dirs and if found, copy it
> to
> > > the temp directory.
> > >
> > > say in my current dir i have chk/src/a.txt and chk/src2/a.txt and
> > > chk/src2/b.txt
> > >
> > > the task should find a.txt under src and src2 and copy it to chk/test
> dir
> > > with folder names
> > >
> > > Can this be done in any way..
> > >
> > > Thanks
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: Need help!! Ant find duplicate files
Posted by "Adam Leggett (UPCO)" <ad...@upco.co.uk>.
Ok, if your preference is javascript you could try the optional
scriptdef task instead:
http://ant.apache.org/manual/OptionalTasks/scriptdef.html
The above page provides an example of how to iterate through filesets
which should give you a good start.
Thanks
Adam
On Wed, 2009-11-11 at 02:28 -0800, cvsusr wrote:
> I really need to learn scripting and do it.. Can I used java script?? I will
> give a try..
>
> Is it so that i need to write java script and call it using groovy task??
>
>
> Adam Leggett (UPCO) wrote:
> >
> > If you are comfortable with scripting using syntax akin to Java, i'd
> > suggest you use the groovy ant task to do something like this
> >
> > http://groovy.codehaus.org/The+groovy+Ant+Task
> >
> >
> > Thanks
> >
> > Adam
> >
> > On Wed, 2009-11-11 at 02:13 -0800, cvsusr wrote:
> >> Is there any Ant experts who can provide a solutions for this scenario...
> >> ??
> >>
> >> Thanks in advance..
> >>
> >>
> >>
> >>
> >> cvsusr wrote:
> >> >
> >> > Hi
> >> >
> >> > In my ant build,
> >> >
> >> > I need to find duplicate files under set of dirs and if found, copy it
> >> to
> >> > the temp directory.
> >> >
> >> > say in my current dir i have chk/src/a.txt and chk/src2/a.txt and
> >> > chk/src2/b.txt
> >> >
> >> > the task should find a.txt under src and src2 and copy it to chk/test
> >> dir
> >> > with folder names
> >> >
> >> > Can this be done in any way..
> >> >
> >> > Thanks
> >> >
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Need help!! Ant find duplicate files
Posted by cvsusr <sp...@rediffmail.com>.
I really need to learn scripting and do it.. Can I used java script?? I will
give a try..
Is it so that i need to write java script and call it using groovy task??
Adam Leggett (UPCO) wrote:
>
> If you are comfortable with scripting using syntax akin to Java, i'd
> suggest you use the groovy ant task to do something like this
>
> http://groovy.codehaus.org/The+groovy+Ant+Task
>
>
> Thanks
>
> Adam
>
> On Wed, 2009-11-11 at 02:13 -0800, cvsusr wrote:
>> Is there any Ant experts who can provide a solutions for this scenario...
>> ??
>>
>> Thanks in advance..
>>
>>
>>
>>
>> cvsusr wrote:
>> >
>> > Hi
>> >
>> > In my ant build,
>> >
>> > I need to find duplicate files under set of dirs and if found, copy it
>> to
>> > the temp directory.
>> >
>> > say in my current dir i have chk/src/a.txt and chk/src2/a.txt and
>> > chk/src2/b.txt
>> >
>> > the task should find a.txt under src and src2 and copy it to chk/test
>> dir
>> > with folder names
>> >
>> > Can this be done in any way..
>> >
>> > Thanks
>> >
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
--
View this message in context: http://old.nabble.com/Ant-find-duplicate-files-tp26230907p26299131.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Need help!! Ant find duplicate files
Posted by "Adam Leggett (UPCO)" <ad...@upco.co.uk>.
If you are comfortable with scripting using syntax akin to Java, i'd
suggest you use the groovy ant task to do something like this
http://groovy.codehaus.org/The+groovy+Ant+Task
Thanks
Adam
On Wed, 2009-11-11 at 02:13 -0800, cvsusr wrote:
> Is there any Ant experts who can provide a solutions for this scenario... ??
>
> Thanks in advance..
>
>
>
>
> cvsusr wrote:
> >
> > Hi
> >
> > In my ant build,
> >
> > I need to find duplicate files under set of dirs and if found, copy it to
> > the temp directory.
> >
> > say in my current dir i have chk/src/a.txt and chk/src2/a.txt and
> > chk/src2/b.txt
> >
> > the task should find a.txt under src and src2 and copy it to chk/test dir
> > with folder names
> >
> > Can this be done in any way..
> >
> > Thanks
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org