You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Gilbreath, Jason" <jg...@solant.com> on 2000/11/22 00:22:20 UTC

fileset question

I apologize for the length, but I have a specific need:

	I have three directories: /new, /backup, /orig

	I am unjarring a file into /new which at the end of the process will
contain just directories (with files underneath of course) as:

		/new/a
		/new/b
		/new/c

		where a,b, and c are directories

	I need to backup directories of the same name (and the files
underneath) in /orig and move (or copy) them to /backup.

		for example,  /orig contains directories a,b,c,d,e and I
need to move a,b,c to /backup

	Once that is complete I need to move the directories in /new to
/orig (easy with a move task)

	The problem is this: I will never know the names of a,b,c (they can
change at any time) and I want to do it without copying all of /orig to
/backup.  

	I have tried using the following:

		<move todir="${backup}">
               		 <fileset dir="${orig}" >
                    			<patternset id="changes"
includesfile="${install.dir}/file.txt" />                           
                                     </fileset>
            	</move>

	
	where file.txt contains the names of the directories in /new (a
simple ls -1 of the /new directory), but this simply moves an empty
directory to the backup directory (the copy task does the same thing).  

	In other words, the directories in /orig never get completely copied
to /backup, only the directory but not the files underneath the directory.  

	I have been through several other scenarios, all of which do not
work for the problem I have.

	If anyone has any ideas, it would be greatly appreciated.

-jason