I want to traverse through subdirectories and perform compiling for each Delphi project. The project file has .dpr extension. I created File/Fileset Iterator with following file source.
%ROOT%\%MAIN_DIR%\*.dpr
The problem is that the iterator returns more files than it should. Here's it's output:
Including Project: C:\BUILD SCRIPTS\FB-LIB\CommonActions.fbp7 Setting Variable : [ROOT] to : C:\BUILDS\CSTA_ACSE Setting Variable : [MAIN_DIR] to : LIB\COMMUNICATION
Searching for Files... Found 3 Files. C:\BUILDS\CSTA_ACSE\LIB\COMMUNICATION\ACSE\ACSE.dproj C:\BUILDS\CSTA_ACSE\LIB\COMMUNICATION\ACSE\Test\ACSETests.dpr C:\BUILDS\CSTA_ACSE\LIB\COMMUNICATION\ACSE\Test\ACSETests.dproj Variable DELPHI_PROJECT_FILE set to C:\BUILDS\CSTA_ACSE\LIB\COMMUNICATION\ACSE\ACSE.dproj
But it should not report any .dproj file, since it is not *.dpr* mask
This is actually how file masks in Windows work, see for yourself by opening the common prompt and running ‘DIR /s *.dpr’ in the same directory, you’ll notice that it does the same thing as FinalBuilder.
So it seems to be an old bug in Windows/DOS system, maybe due to inheritance of DOS 8.3 filename structure. I don't think do Microsoft will fix this bug. I suppose I can get correct results using if/then structure as a child to fileset iterator action.
What do you think about adding extra checkbox like "strict wildmask check" to this action? That would prevent from adding extra checking in the project.
Posted By Vincent Parrett on 26 Nov 2010 02:02 AM A better option would be to define a FileSet and then you can use the Exclude patterns to exclude the files.
Yes, it works as a walkaround for this specific case. I can define fileset for *.dpr and then exclude *.dproj files explicitly. However, in other cases it might be not so easy. I can imagine a situaction when we want to do something with *.c files, but we also have *.cpp, *.cache , *.cfg, *.chm, *.class, *.css, *csv. In such case it is harder to say what we don't need than say what we need.
> I can imagine a situaction when we want to do something with *.c files, but we also have *.cpp, *.cache , *.cfg, *.chm, *.class, *.css, *csv
I’m not sure what you’re trying to suggest here but *.c will not match .cpp, .cache or any thing other then .c file extensions. The behavior that you’re seeing is not that *.c is being treated as .c, but *.dpr is matching both .dpr and .dproj, and if you think about it, that is the correct behavior when 8.3 filenames are enabled on the system as both extensions will be .dpr in 8.3 format. If you don’t like this behavior then disable 8.3 filenames on the system, simple as that.