Some questions about filesets:
1. Is it recommended to use filesets only when there are multiple files, or are there benefits to using filesets for single files? The name of my file is something lie%variable1%%variable2%.txt. It seems easier to put that in a fileset that has an easier name to type such as %importlog%, and then my 4-5 actions later on can call the easier name. Or am I complicating things by creating an unnecessary fileset?
2. What’s the best way to rename a file inside a fileset… and have the fileset point to the new name? Is there even a way to add more files to a fileset after it’s already been defined? Doesn’t seem like it.
Hi Katie,
Typically I use FileSets only when I have multiple files to perform the same action on, or a file that I would like to find in that list. Typically for single file operations (sometimes even trying to find a file) I have the filename stored in a variable.
With that said, note that filesets also store other information about the file. Sometimes having the directory, filename, and creation date/time (etc) available all in one variable makes things a lot simpler.
A FileSets definition can not be changed after its been defined. So if the FileSet is including files in the path C:\Temp and its mask is . then it will never contain files from C:\AnotherTemp directory. It can however contain new files from the directory for which it is defined.
An example of this is when a folder has files which need to be renamed, then another action performed on them while they are in the same directory. So taking our example FileSet from above (“C:\Temp” with a mask of .) if we rename a file called “RenameMe.txt” to “IAmNowRenamed.txt” and then refresh the FileSet the new “IAmNowRenamed.txt” will appear in the FileSet.
This is sometimes required for two reasons;
A. We need to see the new file
B. We don’t want a reference to the old file in our list
So in summary there is no way to add to a FileSets definition, if this is required we create a new FileSet. If the files captured by the FileSet definition change, then we can refresh the FileSet. An option which is available on all FileSet actions.