You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Praveen Savur <Pr...@Sun.COM> on 2004/02/18 23:34:52 UTC
backup files being overwritten before executing the unzip task
Hi all,
I want to do the following task with ant,
1) There are a set of files in directory DirX.
2) There is another set of files in a zip file ZipFileX.
3) I want to extract the contents of ZipFileX into DirX, but before
doing that I want to take a backup of only those files in DirX which
will be overwritten by the unzipping of ZipX.
I tried this approach: Get the contents of the files in ZipX in a
fileSet. But the problem is this fileSet cannot be used to take a
backup(move/copy/rename) of files in DirX.
So is there any other way to do this.
Thanks,
Praveen
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: backup files being overwritten before executing the unzip task
Posted by Matt Benson <gu...@yahoo.com>.
--- Praveen Savur <Pr...@Sun.COM> wrote:
> Unzipping into a temporary directory is not a
> problem. But still the original problem remains -
> How to select only those files in DirX which have a
> corressponding file in the temporary directory.
>
see
http://ant.apache.org/manual/CoreTypes/selectors.html#presentselect
-Matt
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: backup files being overwritten before executing the unzip task
Posted by Praveen Savur <Pr...@Sun.COM>.
In solution (2)
2. Unzip to a temporary directory, then backup files
in DirX that also exist in the temporary directory,
then copy over the files from the temporary directory
to DirX.
Unzipping into a temporary directory is not a problem. But still the original problem remains - How to select only those files in DirX which have a corressponding file in the temporary directory.
Matt Benson wrote:
>--- Praveen Savur <Pr...@Sun.COM> wrote:
> 1) There are a set of files in directory DirX.
>
>
>>2) There is another set of files in a zip file
>>ZipFileX.
>>3) I want to extract the contents of ZipFileX into
>>DirX, but before
>>doing that I want to take a backup of only those
>>files in DirX which
>>will be overwritten by the unzipping of ZipX.
>>
>> So is there any other way to do this.
>>
>>
>>
>
>1. Write a custom task, or
>2. Unzip to a temporary directory, then backup files
>in DirX that also exist in the temporary directory,
>then copy over the files from the temporary directory
>to DirX.
>
>-Matt
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail SpamGuard - Read only the mail you want.
>http://antispam.yahoo.com/tools
>
>---------------------------------------------------------------------
>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: backup files being overwritten before executing the unzip task
Posted by Matt Benson <gu...@yahoo.com>.
--- Praveen Savur <Pr...@Sun.COM> wrote:
1) There are a set of files in directory DirX.
> 2) There is another set of files in a zip file
> ZipFileX.
> 3) I want to extract the contents of ZipFileX into
> DirX, but before
> doing that I want to take a backup of only those
> files in DirX which
> will be overwritten by the unzipping of ZipX.
>
> So is there any other way to do this.
>
1. Write a custom task, or
2. Unzip to a temporary directory, then backup files
in DirX that also exist in the temporary directory,
then copy over the files from the temporary directory
to DirX.
-Matt
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org