CString question
-
im using CFileFind to search for certen file types (EG. .log .tmp .bak" the way i have it is after it finds a file it run another loop to check all the file types im looking for is there a better and fast way to check if the file found matches what im looing for? is there a way to put all the file types in a string and check it once for each file found instead of the loop? and im checking each file found against 2 other list a file exclue and path exclude list. :confused: as it is it takes about 6 mins to scan all of my harddrives.
-
im using CFileFind to search for certen file types (EG. .log .tmp .bak" the way i have it is after it finds a file it run another loop to check all the file types im looking for is there a better and fast way to check if the file found matches what im looing for? is there a way to put all the file types in a string and check it once for each file found instead of the loop? and im checking each file found against 2 other list a file exclue and path exclude list. :confused: as it is it takes about 6 mins to scan all of my harddrives.
-
im using CFileFind to search for certen file types (EG. .log .tmp .bak" the way i have it is after it finds a file it run another loop to check all the file types im looking for is there a better and fast way to check if the file found matches what im looing for? is there a way to put all the file types in a string and check it once for each file found instead of the loop? and im checking each file found against 2 other list a file exclue and path exclude list. :confused: as it is it takes about 6 mins to scan all of my harddrives.
For each file found, call
PathFindExtension()
to get its extension. Then just compare that extension with those in your list (e.g., .log, .tmp, .bak).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
For each file found, call
PathFindExtension()
to get its extension. Then just compare that extension with those in your list (e.g., .log, .tmp, .bak).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
its not just extensions im searching for for some ill find the whole thing like "readme.txt" for some i need to find just the first part like "readme" for the rest it will be the extension i have it where it breaks the word down from "readme.txt" to "readme" ".txt" and i check all 3 but it is very slow running the loop for every file found right now there is about 30 different things im searching for so for each file found the loop runs 30 times and there is 3 list so for each file and folder found the loop really runs about 40 times thats why i need a way to check all 30 at once.
-
its not just extensions im searching for for some ill find the whole thing like "readme.txt" for some i need to find just the first part like "readme" for the rest it will be the extension i have it where it breaks the word down from "readme.txt" to "readme" ".txt" and i check all 3 but it is very slow running the loop for every file found right now there is about 30 different things im searching for so for each file found the loop runs 30 times and there is 3 list so for each file and folder found the loop really runs about 40 times thats why i need a way to check all 30 at once.
locoone wrote:
...i need a way to check all 30 at once.
You can't get around this requirement. In other words, if you are looking for .log, .tmp, and .bak files, you will need to do three checks for each file found. Does this help?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne