You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Pepersack, Bob G" <Ro...@vips.com> on 2012/08/03 21:20:21 UTC

Tar Task Does Not Tar Empty Directories

Hi all,

I'm getting files and directories out of SVN with SvnAnt.  Some of the directories are empty.  Then I'm using the <tar> task to put them into tar files.  I would like the empty directories to be in the tar file, but I can't get the <tar> task to include them.  Here is my tar target:

    <target name="tar">
        <patternset id="ksh.file">
            <include name="**/*.ksh" />
        </patternset>
        <patternset id="other.file">
            <exclude name="**/*.ksh" />
        </patternset>
        <tar destfile="mytarfile.tar">
            <tarfileset dir="${my.dir}" prefix="app" filemode="${ksh.file.perm}" dirmode="${dir.perm}">
                <patternset refid="ksh.file" />
            </tarfileset>
            <tarfileset dir="${my.dir}" prefix="app" filemode="${other.file.perm}" dirmode="${dir.perm}">
                <patternset refid="other.file" />
            </tarfileset>
        </tar>
    </target>

I've tried using a number of different patterns, including **/*, **/**, and **/.  I've also tried directory sets in my <tar> task.

Thanks.