Is it possible to exclude a single directory from a fileset?

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
2 posts Page 1 of 1

david_SD

Posts: 4
Joined: Thu Sep 11, 2014 9:28 am

Post by david_SD » Thu Dec 11, 2014 11:46 am
I have a process that zips up a folder on a network file share and I'd like it to exclude a single folder (and it's contents) from the zip. I have the fileset set to recursive so it will collect other file contents though when I try to exclude a single folder (I've tried ".git", "*.git*", or "*git*"), it seems to be performing a filename exclusion and includes the entire directory in the zip.
Code: Select all
	<fileset dir="//servername/development/projects" recursive="true">
		<wildcardFilter>
			<exclude pattern=".git" />
		</wildcardFilter>
	</fileset>
As I fallback, I can copy the directory to a workspace, delete the .git folder, and then zip up what's left, though I was hoping to perform this within the fileset as the include/exclude features seem to imply that something like this should be possible. Note that the other file/folder names are dynamic so I can't just set a series of INCLUDEs for every other file/directory.

Support_Rick

Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Thu Dec 18, 2014 8:30 am
David,

The Create File List and FileSet Task/Commands do just that, create (Including/Excluding) Files from a Folder. Under the rules of Include/Exclude, a folder is only "Excluded" if no files exists in the folder matching the desired pattern.

To Exclude a folder (regardless of file names) you would need to do an "Exclude *.*"

Otherwise, there is a Tips and Tricks Email that I sent out recently explaining how to perform (Project code included) a Folder Selection that might help you in this endeavor. It can be found at the following link:

Working with Folders

Your only other option is to retrieve the file list (including the folder you do not want to process) and then looping through that FileList with your first statement inside the loop being :

<iterateLoop condition="${ contains( '\MyFolderName\', false )}

That way you process what you're needing, then remove the folders you do not want to process.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1