0

i need to move a file from dir A to dir B with ant.

File's name can have unspecified extension such as logo.png, logo.gif, logo.jpg and go on.

Can you help me, please?

Regards

Premier
  • 4,160
  • 6
  • 44
  • 58

1 Answers1

2

This snippet moves all files with name starting with logo. from A to B. Perhaps you are looking for something similar?

  <move todir="B">
    <fileset dir="A">
      <include name="**/logo.*"/>
    </fileset>
  </move>
Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • Sorry, i, also, need to copy rename it – Premier Jan 03 '11 at 13:41
  • @Premier You should give some example of what you want to do by editing your question so that someone can respond – Raghuram Jan 04 '11 at 05:22
  • thank you. I have mistaken to make the question. In my app i can have an image with name "logo" and unknow suffix. The suffix can be ".png",".jpg",".bmp",... I need to copy the image in a directory B and rename the image to "logo.png". So, i've solved with a custom task, but i'm interested to your solution. – Premier Jan 04 '11 at 14:56
  • @Premier Perhaps this stackoverflow discussion is of some help - http://stackoverflow.com/questions/1244049/renaming-files-during-ant-copy – Raghuram Jan 05 '11 at 05:06