I'd like to change file attributes on a whole heap of files, and the "one filespec at a time" approach of "SetFileAttributes" does not appeal (I'd need more than 10 of them). Ideally I'd like to use a list file, but a FileSet would also work. I just can't see how to combine the two.
Should I just write a custom action or is there an easier way?
What I'm trying to do is avoid creating a changelist in Perforce just to build all the projects in the script with new version information, only to discard the changelist afterwards. Since we have a geriatric version of the Perforce Server for cost reasons the Perforce Revert action doesn't work (neither does submit) and I'm trying to get around that by just changing file attributes.
I reckon the easiest way would be to use a Define Fileset action to select the files you want, and then use a File Iterator action to process each file individually (to actually process each file, use a Set File Attributes action as a child of the File Iterator, and use the variable from the File Iterator).
OK, playing with that I have a FileSet but no attribute changing. So I put a "log variable values" call in and still go no iterations. The "Status" column shows green with text "Iteration 1 of 171" but never gets to 2. Afterwards was the "set attribute" step but it didn't find the file specified even though that file exists. Help!
No files were found matching the file spec. ------------------------- The "..." above is just a list of 170 more files, the log step didn't produce any output that I can see.
It's annoying that when I right-click and go "copy" on the build log nothing happens unless I'm right clicking on a log output line - doing that on an action description does nothing. Likewise, the secret "Ctrl-A to select all" command doesn't select the command descriptions so the resulting text is harder to understand than it could be. Hence my extra description above.
OK, the solution is to add a “String quoting” action that removes the quotes from the variable before the file set attribute action. I think that’s a bug, guv.
As a test, if you paste a valid filename into set attribute and make sure it works, then quote the filename it will no longer work.
Thanks for the reply. If you set the “Default Quoting” on the FileSet to None (the default), then you should not need the “String Quoting” action any more.
We’ll modify the File Iterator action so it can take quoted pathnames, however in FinalBuilder there should be no need to ever quote an argument manually, unless you’re explicitly passing it to an external program (ie the Execute Program action.)