You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Paul Schabl <p....@solco.at> on 2008/08/25 12:28:42 UTC
Renaming files during copy
Hej,
The following target copies and renames files as expected,
but also creates emtpy directories named "somedir.deploy".
How can i make sure, that only files get renamed during copy?
<target name="copy"
description="copies and packages files">
<copy todir="${update.files.dir}" preserveLastModified="true">
<fileset dir="${deploy.dir}" casesensitive="false">
<different targetdir="${update.last.dir}" ignoreFileTimes="true" />
</fileset>
<globmapper from="*.*" to="*.deploy"/>
</copy>
</target>
Thanks and Regards,
Paul Schabl
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Renaming files during copy
Posted by Paul Schabl <p....@solco.at>.
Unluckily, all directories get renamed
Thanks for your suggestion,
Paul Schabl
Am 25.08.2008 um 18:59 schrieb David Weintraub:
> You mention that the renamed directories are empty. Are all the
> directories renamed, or only the empty ones?
>
> If it is only the empty ones, can you add the includeEmptyDirs="false"
> parameter to your copy task?
>
>
> --
> David Weintraub
> qazwart@gmail.com
>
>
>
> On Mon, Aug 25, 2008 at 6:28 AM, Paul Schabl <p....@solco.at>
> wrote:
>> Hej,
>>
>> The following target copies and renames files as expected,
>> but also creates emtpy directories named "somedir.deploy".
>> How can i make sure, that only files get renamed during copy?
>>
>>
>> <target name="copy"
>> description="copies and packages files">
>>
>> <copy todir="${update.files.dir}"
>> preserveLastModified="true">
>> <fileset dir="${deploy.dir}"
>> casesensitive="false">
>> <different targetdir="$
>> {update.last.dir}"
>> ignoreFileTimes="true" />
>> </fileset>
>> <globmapper from="*.*" to="*.deploy"/>
>> </copy>
>> </target>
>>
>> Thanks and Regards,
>> Paul Schabl
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
Mit freundlichen Gr��en,
Paul Schabl
Re: Renaming files during copy
Posted by David Weintraub <qa...@gmail.com>.
You mention that the renamed directories are empty. Are all the
directories renamed, or only the empty ones?
If it is only the empty ones, can you add the includeEmptyDirs="false"
parameter to your copy task?
--
David Weintraub
qazwart@gmail.com
On Mon, Aug 25, 2008 at 6:28 AM, Paul Schabl <p....@solco.at> wrote:
> Hej,
>
> The following target copies and renames files as expected,
> but also creates emtpy directories named "somedir.deploy".
> How can i make sure, that only files get renamed during copy?
>
>
> <target name="copy"
> description="copies and packages files">
>
> <copy todir="${update.files.dir}"
> preserveLastModified="true">
> <fileset dir="${deploy.dir}" casesensitive="false">
> <different targetdir="${update.last.dir}"
> ignoreFileTimes="true" />
> </fileset>
> <globmapper from="*.*" to="*.deploy"/>
> </copy>
> </target>
>
> Thanks and Regards,
> Paul Schabl
>
>
> ---------------------------------------------------------------------
> 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
Re: Renaming files during copy
Posted by Paul Schabl <p....@solco.at>.
Works great, many thanks!
Paul Schabl
Am 25.08.2008 um 23:51 schrieb David Weintraub:
> Well, you're already using one Selector, why not use the "type"
> selector too:
>
> <target name="copy"
> description="copies and packages files">
>
> <copy todir="${update.files.dir}"
> preserveLastModified="true">
> <fileset dir="${deploy.dir}" casesensitive="false">
> <different targetdir="${update.last.dir}"
> ignoreFileTimes="true" />
> <type type="file"/> <!-- Type Selector
> Selecting Files Only -->
> </fileset>
> <globmapper from="*.*" to="*.deploy"/>
> </copy>
> </target>
>
> If you need empty folders too, you might have to do another copy, but
> with <type type="dir"/>.
>
> --
> David Weintraub
> qazwart@gmail.com
>
>
>
> On Mon, Aug 25, 2008 at 6:28 AM, Paul Schabl <p....@solco.at>
> wrote:
>> Hej,
>>
>> The following target copies and renames files as expected,
>> but also creates emtpy directories named "somedir.deploy".
>> How can i make sure, that only files get renamed during copy?
>>
>>
>> <target name="copy"
>> description="copies and packages files">
>>
>> <copy todir="${update.files.dir}"
>> preserveLastModified="true">
>> <fileset dir="${deploy.dir}"
>> casesensitive="false">
>> <different targetdir="$
>> {update.last.dir}"
>> ignoreFileTimes="true" />
>> </fileset>
>> <globmapper from="*.*" to="*.deploy"/>
>> </copy>
>> </target>
>>
>> Thanks and Regards,
>> Paul Schabl
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Renaming files during copy
Posted by David Weintraub <qa...@gmail.com>.
Well, you're already using one Selector, why not use the "type" selector too:
<target name="copy"
description="copies and packages files">
<copy todir="${update.files.dir}"
preserveLastModified="true">
<fileset dir="${deploy.dir}" casesensitive="false">
<different targetdir="${update.last.dir}"
ignoreFileTimes="true" />
<type type="file"/> <!-- Type Selector
Selecting Files Only -->
</fileset>
<globmapper from="*.*" to="*.deploy"/>
</copy>
</target>
If you need empty folders too, you might have to do another copy, but
with <type type="dir"/>.
--
David Weintraub
qazwart@gmail.com
On Mon, Aug 25, 2008 at 6:28 AM, Paul Schabl <p....@solco.at> wrote:
> Hej,
>
> The following target copies and renames files as expected,
> but also creates emtpy directories named "somedir.deploy".
> How can i make sure, that only files get renamed during copy?
>
>
> <target name="copy"
> description="copies and packages files">
>
> <copy todir="${update.files.dir}"
> preserveLastModified="true">
> <fileset dir="${deploy.dir}" casesensitive="false">
> <different targetdir="${update.last.dir}"
> ignoreFileTimes="true" />
> </fileset>
> <globmapper from="*.*" to="*.deploy"/>
> </copy>
> </target>
>
> Thanks and Regards,
> Paul Schabl
>
>
> ---------------------------------------------------------------------
> 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