ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: tar task: how to include empty dirs
Date Thu, 07 Dec 2000 12:21:24 GMT
Anthony Goubard <> wrote:

> Stefan Bodewig wrote:
>> Wim Bervoets <> wrote:
>> > The Tar task doesn't seem to tar empty directories. How can I
>> > tell it to do that?
>> You are right, it doesn't. If you look into the generated tar files
>> you'll notice that it doesn't store any directories at all. Two
>> options: (1) modify to store directories as well, (2) use
>> <exec> or <execon> and command line tar.
>> If you chose option (1), a patch to ant-dev would be much
>> appreciated 8-)
> If you patch the tar file, can you do the same thing for the
> that also doesn't include empty directories.

Not entirely true, as long as you include at least one file somewhere,
<zip> will include empty dirs as well, i.e.

    <delete dir="" />
    <mkdir dir="" />
    <touch file="" />
    <zip zipfile="" basedir="" />

will work and include both testdir and testfile, while it won't do
anything if you remove the <touch> task. Speaking of Ant 1.2 that is
as I fixed Zip in CVS seconds ago 8-).


View raw message