Tonight I face a very strange problem, when trying to copy the project binary file tree to my Linux system for testing, some part of the directory is missing. I check the batch file which handle the copy task, found out I use the 'xcopy' command, with a exclude
List. I have examining the exclude.txt file quite of careful, but can't find any problems. finally, I notice that the missing directory, name 'tool', underneath has two text files, those are 'makeinc. bat 'and 'make _ Inc. sh', And I delete the excluding item
One by one, and notice the changes, finally I found out that under the exclude.txt file, there is a item name 'inc' really take the effect, so I understand what is going on. 'inc' in fact is a folder name, that I really want to skip copying, but this seach
Condition also match the file named with 'make _ Inc. sh' and 'makeinc. bat ', so when xcopy meet those files, and skip copy, also skip the upper folder that contain these (and only these) two items. if we want to use xcopy with a exclude list, the folder or file
Names has the same search key word wocould be skipped, that's a really tragic.
But fortunately, there is a solution, when escaping directories or folders, try to use the word '\ Inc \' but not the word 'inc', notice there are two back slash being added, this will guarantee the searching app always match the key word with directories names
But not the file names, it's good!