ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Charters <>
Subject ant <tar> and <jar> tasks do not preserve file permissions?
Date Fri, 20 Sep 2002 16:51:11 GMT

i just created a save task to compress the entire dir into a dated jar 
file ... so that before i make major changes in my program i have a 

unfortunately, the ant jar task does not preserve the permissions on the 
files when it saves (i am running linux and have scripts for doing 
things in my project ... and it does not save the executable 
permission in the jar file)...

i decided to try the tar task instead ... and that produces the same 
problem -- the permissions are not saved

anyone know how to get jar or tar to preserve the permissions?  or does 
anyone have a better way for me to do what i am doing (just making a 
backup of my entire build dir)

here are the targets that i created:

  <target name="save"
          depends="getDate, getTime"
          description="create a save jar in ${saveDir}/${currentLS}-${today}-${timenow}.jar">
    <jar jarfile="${saveDir}/${currentLS}-${today}-${timenow}.jar"
    <echo message="The jarfile is in ${saveDir}/${currentLS}-${today}-${timenow}.jar"/>

  <target name="savetar"
          depends="getDate, getTime"
          description="create a save tar in ${saveDir}/${currentLS}-${today}-${timenow}.tar">
    <tar tarfile="${saveDir}/${currentLS}-${today}-${timenow}.tar"
      <exclude name="${saveDir}/**"/>
      <exclude name="${classDir}/**"/>
    <gzip src="${saveDir}/${currentLS}-${today}-${timenow}.tar" zipfile="${saveDir}/${currentLS}-${today}-${timenow}.tar.gz"/>
    <delete file="${saveDir}/${currentLS}-${today}-${timenow}.tar"/>
    <echo message="The tarfile is in ${saveDir}/${currentLS}-${today}-${timenow}.tar"/>

any help would be appreciated.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message