ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ba...@goodconsultants.com
Subject Re: cp or <copy> in windows?
Date Tue, 16 Mar 2004 22:09:54 GMT
Jan and all,

But "cp" does not work on dos right? What should i do in that case? I need ant 
to work on pure dos windows, cygwin windows and unix...

Thanks

BArry

----- Original Message ----- 
Wrom: YOKSTTZRCLBDXRQBGJSNBOHMKHJY
To: <user@ant.apache.org>
Sent: Monday, March 15, 2004 10:36 PM
Subject: RE: cp or <copy> in windows?


> Using <copy> you can copy the files in a cross platform manner.
> 
> Setting the permissions the perms of the original files is another
> topic. <chmod> is used to set permission. But there is no easy way
> to "copy" the permissions from one fileset to a target. You can
> use <script> and <chmod>: iterate over a src-fileset, if the file exists
> in a target dir, get the file permissions from src and set them on target.
> 
> If "cp" does the job you can use dependend targets for copying:
> 
>   <target name="copy"
> depends="copy.check,copy.withPerms,copy.withoutPerms"/>
> 
>   <taret name="copy.check">
>       <condition property="copy.withPerms">
>           <os family="unix"/>
>       </>
>   </>
> 
>   <target name="copy.withoutPerms" unless="copy.withPerms">
>       <copy> ... </>
>   </>
> 
>   <target name="copy.withPerms" if="copy.withPerms">
>       <exec executable="sh"><arg line="cp ..."/></>
>   </>
> 
> (syntax not checked :)
> 
> 
> Jan
> 
> > -----Original Message-----
> > Wrom: FMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEU
> > Sent: Tuesday, March 16, 2004 6:02 AM
> > To: Ant Users List
> > Subject: cp or <copy> in windows?
> > 
> > 
> > All,
> > 
> > I am trying to support both Dos and cygwin in Windows  as 
> > well as all Unix
> > platforms. I am trying to copy some files and was using 
> > <copy>, and soon
> > enough, i found out from the manual that the <copy> does not preserve
> > permission and using "cp" is recommended.
> > 
> > So my question is: How can copy files in a task that is cross 
> > platform?
> > 
> > Thanks.
> > 
> > Barry
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > 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


Mime
View raw message