You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Akbar Ibrahim <ak...@wipro.com> on 2000/09/25 13:36:09 UTC

Copying and renaming

Hi,

I would like to copy files and rename them at the same time.

For example, I want to copy all *_abc.txt files (from a src directory tree)
to *_123.txt files (in a dest directory tree). ie

src/f_abc.txt  -> dest/f_123.txt
src/dir/g_abc.txt -> dest/dir/g_123.txt
...

I looked at the copy, copydir and rename tasks but could not find out any
way of doing this.

Is this possible ? I have ant 1.1  (compiled on July 18 2000)

Cheers,
Akbar





Wildcard copy and move (was Re: Copying and renaming in ANT-USER)

Posted by Akbar Ibrahim <ak...@wipro.com>.
----- Original Message -----
From: "Akbar Ibrahim" <ak...@wipro.com>
To: <an...@jakarta.apache.org>
Sent: Monday, September 25, 2000 10:25 PM
Subject: Re: Copying and renaming


> > Yes: First switch to current Ant instead of Ant 1.1 if you want to
> > contribute tasks - just to ensure it fits with some architectural
> > changes.
> >
> > Second join the ant-dev list.
> >
> > Third wait for Glenn McAllister to commit the new copy and move tasks
> > (together with a modified delete task). We are going to replace
> > copyfile/copydir with a single copy task and do the same for
> > delete/deltree. Rename is going to be called move because this is
> > closer to what it does.
> >
> > Whatever you have in mind will probably benefit from extending the
> > copy or move task.
> >
> > Stefan
> >


Looks like copy, delete and move tasks have been committed. If there is not
going to be any drastic change in these tasks I could start my work on the
wildcard copy and move tasks.

Any suggestions ?

Akbar



Re: Copying and renaming

Posted by Akbar Ibrahim <ak...@wipro.com>.
> Yes: First switch to current Ant instead of Ant 1.1 if you want to
> contribute tasks - just to ensure it fits with some architectural
> changes.


Yep. I will do that.


>
> Second join the ant-dev list.
>


I am already in the list. Have been lurking for a long time, contributing
once in a blue moon :)


> Third wait for Glenn McAllister to commit the new copy and move tasks
> (together with a modified delete task). We are going to replace
> copyfile/copydir with a single copy task and do the same for
> delete/deltree. Rename is going to be called move because this is
> closer to what it does.
>
> Whatever you have in mind will probably benefit from extending the
> copy or move task.


Will do. Will have to read the cvs commit messages now, I suppose. :)


>
> Stefan
>


Akbar



Re: Copying and renaming

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "AI" == Akbar Ibrahim <ak...@wipro.com> writes:

 AI> I feel a wildcard rename/copy would be very useful. I could go
 AI> ahead and write a task for it.

 AI> Any suggestions ?

Yes: First switch to current Ant instead of Ant 1.1 if you want to
contribute tasks - just to ensure it fits with some architectural
changes.

Second join the ant-dev list.

Third wait for Glenn McAllister to commit the new copy and move tasks
(together with a modified delete task). We are going to replace
copyfile/copydir with a single copy task and do the same for
delete/deltree. Rename is going to be called move because this is
closer to what it does.

Whatever you have in mind will probably benefit from extending the
copy or move task.

Stefan

Re: Copying and renaming

Posted by Akbar Ibrahim <ak...@wipro.com>.
I feel a wildcard rename/copy would be very useful. I could go ahead and
write a task for it.

Any suggestions ?

Akbar


----- Original Message -----
From: "Stefan Bodewig" <bo...@bost.de>
To: <an...@jakarta.apache.org>
Sent: Monday, September 25, 2000 6:45 PM
Subject: Re: Copying and renaming


> >>>>> "AI" == Akbar Ibrahim <ak...@wipro.com> writes:
>
>  AI> But can I do a "wildcard" rename, say, rename all *.abc files to
>  AI> *.123 or all *abc* files to *123* files.
>
> Not in general, but there is an optional task to rename the extension
> (i.e. you can do what your example says, but you can't rename file
> a??.txt to b??.txt).
>
> Stefan
>


Re: Copying and renaming

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "AI" == Akbar Ibrahim <ak...@wipro.com> writes:

 AI> But can I do a "wildcard" rename, say, rename all *.abc files to
 AI> *.123 or all *abc* files to *123* files.

Not in general, but there is an optional task to rename the extension
(i.e. you can do what your example says, but you can't rename file
a??.txt to b??.txt).

Stefan

Re: Copying and renaming

Posted by Akbar Ibrahim <ak...@wipro.com>.
But can I do a "wildcard" rename, say, rename all *.abc files to *.123 or
all *abc* files to *123* files.

Akbar


----- Original Message -----
From: "Stefan Bodewig" <bo...@bost.de>
To: <an...@jakarta.apache.org>
Sent: Monday, September 25, 2000 6:03 PM
Subject: Re: Copying and renaming


> >>>>> "AI" == Akbar Ibrahim <ak...@wipro.com> writes:
>
>  AI> Hi, I would like to copy files and rename them at the same time.
>
> Sorry, but we only have copy or move at the moment. All you can do is
> invoke copy and rename one after the other inside the same target.
>
> Stefan
>


Re: Copying and renaming

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "AI" == Akbar Ibrahim <ak...@wipro.com> writes:

 AI> Hi, I would like to copy files and rename them at the same time.

Sorry, but we only have copy or move at the moment. All you can do is
invoke copy and rename one after the other inside the same target.

Stefan