ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conelly, Luis (GNF, Contractor)" <Luis.Cone...@gnf.com>
Subject RE: Requirement to copy from local drive to network drive
Date Wed, 12 May 2004 14:36:56 GMT
I have achieved what you want with:

    <target name="copyFile">
        <copy todir="${location.target}" >
          <fileset dir="${param.mail.dist.dir}">
              <include name="**/*.zip"/>
              <include name="**/*.jar"/>
          </fileset>
          <mapper type="glob" from="*" to="${DSTAMP}-*"/>
        </copy>
    </target>

where 
${location.target} is defined as an UNC path [\\server\sharedresource\directory]
If you define it in a properties file (as I do) you should escape the backslashes, in order
to be well-interpretated by java.util.Properties class; otherwise, you can define it as is.

This has the advantage that works for Win and for *nix, since the path is not hardcoded at
all and can be defined for your favorite OS.

HTH
Regards
Luis

-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
Sent: Wednesday, May 12, 2004 1:03 AM
To: user@ant.apache.org
Subject: RE: Requirement to copy from local drive to network drive 


> I have a zip file . I would like to copy from my local drive 
> to my network
> drive . Can we accomplish this in Ant 1.6.1

I don´t know how you can access your network drive.
If your local machine runs under windows you can map a drive letter
via <exec executable="cmd.exe"><arg line="net use ${letter}
${unc}"/></exec>.

Maybe the <copy> supports UNC - don´t know. You should try that out.



> How to make a zip file with a time stamp .?

First <zip>, then <touch>.



Jan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message