ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chakravarthy, Srikanth" <Srikanth.Chakravar...@misys.com>
Subject RE: Rename a dir
Date Fri, 26 Mar 2010 07:23:38 GMT
Hi,

This chunk of code in the build.xml renames both the file and the folder

<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" default="package">

	<target name="package">
	<move file="sri.xml" tofile="srikanth.xml" /> <!-- Rename a file -->
	<move file="srikm" tofile="srikanth" /> <!-- Rename a folder -->
	</target>

</project>


The folder srikm had subfolders in it and also files in them. The rename was successful.

As you had rightly said, if you use todir, it will move the first dir into the second dir.

Regards,
Srikanth

-----Original Message-----
From: Knuplesch, Juergen [mailto:Juergen.Knuplesch@icongmbh.de] 
Sent: Friday, March 26, 2010 12:34 PM
To: Ant Users List
Subject: AW: Rename a dir

Thanks Antoine,

The ANT docu says:

Since Ant 1.6.3, the file attribute may be used to move (rename) an entire directory. If tofile
denotes an existing file, or there is a directory by the same name in todir, the action will
fail. 

So my code seems to be correct.

I think todir will move the first dir inside the second dir and this is not a rename.

So the question remains: How to rename a dir with ANT 1.7.1 and Windows XP? 

Does anyone know?
Maybe I have a look in the code....

Greetings Juergen


-- 
Jürgen Knuplesch                    www.icongmbh.de
icon Systemhaus GmbH                Tel. +49 711 806098-275
Sophienstraße 40                    
D-70178 Stuttgart                   Fax. +49 711 806098-299

Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 
-----Ursprüngliche Nachricht-----
Von: Antoine Levy Lambert [mailto:antoine@gmx.de] 
Gesendet: Donnerstag, 25. März 2010 18:58
An: Ant Users List
Betreff: Re: Rename a dir

try using the todir attribute instead of tofile. I am not sure what the end result will be
but this might be faster.

Regards,

Antoine

Knuplesch, Juergen wrote:
> Hello,
>
> I want to rename a dir and used the following:
>       <property name="dirbase2.new" location="${dirbase2}BUILDFAILED"/>
>       <move  file="${dirbase2}" tofile="${dirbase2.new}" />
>
> But this moved all the files inside dirbase2 to dirbase2.new:
>      [echo] finally message
>      [move] Moving 14406 files to ...
>
> I just want to rename the dirname!
>
> I use ANT with Windows XP and this is a network path.
>
> Is a way to do this in ANT?
>
> Greetings Jürgen
>
>   


---------------------------------------------------------------------
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



"Misys" is the trade name for Misys plc (registered in England and Wales). Registration Number:
01360027. Registered office: One Kingdom Street, London W2 6BL, United Kingdom. For a list
of Misys group operating companies please go to http://www.misys.com/corp/About_Us/misys_operating_companies.html.
This email and any attachments have been scanned for known viruses using multiple scanners.
This email message is intended for the named recipient only. It may be privileged and/or confidential.
If you are not the named recipient of this email please notify us immediately and do not copy
it or use it for any purpose, nor disclose its contents to any other person. This email does
not constitute the commencement of legal relations between you and Misys plc. Please refer
to the executed contract between you and the relevant member of the Misys group for the identity
of the contracting party with which you are dealing. 

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


Mime
View raw message