You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Raja Nagendra Kumar <na...@tejasoft.com> on 2013/10/07 11:19:57 UTC

Copy task not to overwrite but rename the file as _1 _2 etc..

Hi

Does copy task have any option to rename to be copie file as
existing_file_1.xx etc.. just like windows does rename the existing files..

Regards,
Nagendra



--
View this message in context: http://ant.1045680.n5.nabble.com/Copy-task-not-to-overwrite-but-rename-the-file-as-1-2-etc-tp5714507.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: Copy task not to overwrite but rename the file as _1 _2 etc..

Posted by Matt Benson <gu...@gmail.com>.
No, off the top of my head i can't think of a simple way to do this with a
basic Ant installation.

Matt


On Mon, Oct 7, 2013 at 9:57 AM, Raja Nagendra Kumar <
nagendra.raja@tejasoft.com> wrote:

> **
> Hi Matt,
>
> I meant rename as smart rename... nothing related to move..
>
> e.g I am copying 3 files from different directories.. but all have the
> same name as classes.jar
>
> when all these are copied to a dir xyz, then copy task should let xyz
> would copy classes.jar as is as there is existing classes.jar in xyz dir,
> however for 2nd file copy  it would rename file as classes1.jar, 3rd one is
> copied as classes2.jar etc..
>
> exactly the way windows appends extra strings to file name.. as below
> graphics..
>
>
>
>
> Regards,
> Nagendra
>    *Raja Nagendra Kumar*
> Founder & C.T.O     *Mobile:* +91-9886723872
>  *Email:* nagendra.raja@tejasoft.com
> *IM:* nagendra.raja (Skype)
>  *http://in.linkedin.com/in/nagkumar*
>  *TejaSoft Innovations Pvt Ltd*
>  <http://www.tejasoft.com>
> Factor 4 Results    See who we know in common<http://www.linkedin.com/e/wwk/5094208/?hs=false&tok=0bfzEZotG8slI1> Want
> a signature like this?<http://www.linkedin.com/e/sig/5094208/?hs=false&tok=0uLVu92uq8slI1>
>
>
> On 10/7/2013 7:58 PM, Matt Benson wrote:
>
> To rename files in the same directory you probably want to use the move
> task with a glob mapper; just be careful what files you select to begin
> with.
>
> Matt
> On Oct 7, 2013 9:14 AM, "Raja Nagendra Kumar" <na...@tejasoft.com> <na...@tejasoft.com>
> wrote:
>
>
>  Hi Matt,
>
> Are there any pre-packaged mappers in ant.. which does this mapping by
> default.. For flattening there is one already.. but do not see any for
> rename when file already exists.. requirement of mine..
>
> Regards,
> Nagendra
> On 10/7/2013 7:25 PM, Matt Benson wrote:
>
>
>  It sounds like you want the functionality provided by filename mappers.
>
> Matt
> On Oct 7, 2013 4:20 AM, "Raja Nagendra Kumar"<nagendra.raja@tejasoft.**
> com <na...@tejasoft.com> <na...@tejasoft.com>>
> wrote:
>
>  Hi
>
>
> Does copy task have any option to rename to be copie file as
> existing_file_1.xx etc.. just like windows does rename the existing
> files..
>
> Regards,
> Nagendra
>
>
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.**com/Copy-task-not-to-**
> overwrite-but-rename-the-file-**as-1-2-etc-tp5714507.html<http://ant.1045680.n5.nabble.com/Copy-task-not-to-overwrite-but-rename-the-file-as-1-2-etc-tp5714507.html> <http://ant.1045680.n5.nabble.com/Copy-task-not-to-overwrite-but-rename-the-file-as-1-2-etc-tp5714507.html>
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
> ------------------------------**------------------------------**
> ---------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.**org<us...@ant.apache.org> <us...@ant.apache.org>
>
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.**org<us...@ant.apache.org> <us...@ant.apache.org>
>
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: Copy task not to overwrite but rename the file as _1 _2 etc..

Posted by Raja Nagendra Kumar <na...@tejasoft.com>.
Hi Matt,

I meant rename as smart rename... nothing related to move..

e.g I am copying 3 files from different directories.. but all have the 
same name as classes.jar

when all these are copied to a dir xyz, then copy task should let xyz 
would copy classes.jar as is as there is existing classes.jar in xyz 
dir,  however for 2nd file copy  it would rename file as classes1.jar, 
3rd one is copied as classes2.jar etc..

exactly the way windows appends extra strings to file name.. as below 
graphics..




Regards,
Nagendra
*Raja Nagendra Kumar*
Founder & C.T.O 	
*Mobile:* +91-9886723872
	*Email:* nagendra.raja@tejasoft.com <ma...@tejasoft.com>
*IM:* nagendra.raja (Skype)
*http://in.linkedin.com/in/nagkumar*
	*TejaSoft Innovations Pvt Ltd*
<http://www.tejasoft.com>
Factor 4 Results

See who we know in common 
<http://www.linkedin.com/e/wwk/5094208/?hs=false&tok=0bfzEZotG8slI1> 
Want a signature like this? 
<http://www.linkedin.com/e/sig/5094208/?hs=false&tok=0uLVu92uq8slI1>


On 10/7/2013 7:58 PM, Matt Benson wrote:
> To rename files in the same directory you probably want to use the move
> task with a glob mapper; just be careful what files you select to begin
> with.
>
> Matt
> On Oct 7, 2013 9:14 AM, "Raja Nagendra Kumar"<na...@tejasoft.com>
> wrote:
>
>> Hi Matt,
>>
>> Are there any pre-packaged mappers in ant.. which does this mapping by
>> default.. For flattening there is one already.. but do not see any for
>> rename when file already exists.. requirement of mine..
>>
>> Regards,
>> Nagendra
>> On 10/7/2013 7:25 PM, Matt Benson wrote:
>>
>>> It sounds like you want the functionality provided by filename mappers.
>>>
>>> Matt
>>> On Oct 7, 2013 4:20 AM, "Raja Nagendra Kumar"<nagendra.raja@tejasoft.**
>>> com<na...@tejasoft.com>>
>>> wrote:
>>>
>>>   Hi
>>>> Does copy task have any option to rename to be copie file as
>>>> existing_file_1.xx etc.. just like windows does rename the existing
>>>> files..
>>>>
>>>> Regards,
>>>> Nagendra
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://ant.1045680.n5.nabble.**com/Copy-task-not-to-**
>>>> overwrite-but-rename-the-file-**as-1-2-etc-tp5714507.html<http://ant.1045680.n5.nabble.com/Copy-task-not-to-overwrite-but-rename-the-file-as-1-2-etc-tp5714507.html>
>>>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>>>
>>>> ------------------------------**------------------------------**
>>>> ---------
>>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.**org<us...@ant.apache.org>
>>>> For additional commands, e-mail: user-help@ant.apache.org
>>>>
>>>>
>>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.**org<us...@ant.apache.org>
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>

Re: Copy task not to overwrite but rename the file as _1 _2 etc..

Posted by Matt Benson <gu...@gmail.com>.
To rename files in the same directory you probably want to use the move
task with a glob mapper; just be careful what files you select to begin
with.

Matt
On Oct 7, 2013 9:14 AM, "Raja Nagendra Kumar" <na...@tejasoft.com>
wrote:

> Hi Matt,
>
> Are there any pre-packaged mappers in ant.. which does this mapping by
> default.. For flattening there is one already.. but do not see any for
> rename when file already exists.. requirement of mine..
>
> Regards,
> Nagendra
> On 10/7/2013 7:25 PM, Matt Benson wrote:
>
>> It sounds like you want the functionality provided by filename mappers.
>>
>> Matt
>> On Oct 7, 2013 4:20 AM, "Raja Nagendra Kumar"<nagendra.raja@tejasoft.**
>> com <na...@tejasoft.com>>
>> wrote:
>>
>>  Hi
>>>
>>> Does copy task have any option to rename to be copie file as
>>> existing_file_1.xx etc.. just like windows does rename the existing
>>> files..
>>>
>>> Regards,
>>> Nagendra
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://ant.1045680.n5.nabble.**com/Copy-task-not-to-**
>>> overwrite-but-rename-the-file-**as-1-2-etc-tp5714507.html<http://ant.1045680.n5.nabble.com/Copy-task-not-to-overwrite-but-rename-the-file-as-1-2-etc-tp5714507.html>
>>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.**org<us...@ant.apache.org>
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.**org<us...@ant.apache.org>
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: Copy task not to overwrite but rename the file as _1 _2 etc..

Posted by Raja Nagendra Kumar <na...@tejasoft.com>.
Hi Matt,

Are there any pre-packaged mappers in ant.. which does this mapping by 
default.. For flattening there is one already.. but do not see any for 
rename when file already exists.. requirement of mine..

Regards,
Nagendra
On 10/7/2013 7:25 PM, Matt Benson wrote:
> It sounds like you want the functionality provided by filename mappers.
>
> Matt
> On Oct 7, 2013 4:20 AM, "Raja Nagendra Kumar"<na...@tejasoft.com>
> wrote:
>
>> Hi
>>
>> Does copy task have any option to rename to be copie file as
>> existing_file_1.xx etc.. just like windows does rename the existing files..
>>
>> Regards,
>> Nagendra
>>
>>
>>
>> --
>> View this message in context:
>> http://ant.1045680.n5.nabble.com/Copy-task-not-to-overwrite-but-rename-the-file-as-1-2-etc-tp5714507.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
>>
>>

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


Re: Copy task not to overwrite but rename the file as _1 _2 etc..

Posted by Matt Benson <gu...@gmail.com>.
It sounds like you want the functionality provided by filename mappers.

Matt
On Oct 7, 2013 4:20 AM, "Raja Nagendra Kumar" <na...@tejasoft.com>
wrote:

> Hi
>
> Does copy task have any option to rename to be copie file as
> existing_file_1.xx etc.. just like windows does rename the existing files..
>
> Regards,
> Nagendra
>
>
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Copy-task-not-to-overwrite-but-rename-the-file-as-1-2-etc-tp5714507.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
>
>